mirror of
https://github.com/astaxie/beego.git
synced 2024-11-26 07:11:29 +00:00
Merge pull request #2248 from smacker/RouterPattern-in-ctx
Add RouterPattern to context.Input
This commit is contained in:
commit
b635af5a8c
@ -712,10 +712,8 @@ func (p *ControllerRegister) ServeHTTP(rw http.ResponseWriter, r *http.Request)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if routerInfo != nil {
|
if routerInfo != nil {
|
||||||
if BConfig.RunMode == DEV {
|
//store router pattern into context
|
||||||
//store router pattern into context
|
context.Input.SetData("RouterPattern", routerInfo.pattern)
|
||||||
context.Input.SetData("RouterPattern", routerInfo.pattern)
|
|
||||||
}
|
|
||||||
if routerInfo.routerType == routerTypeRESTFul {
|
if routerInfo.routerType == routerTypeRESTFul {
|
||||||
if _, ok := routerInfo.methods[r.Method]; ok {
|
if _, ok := routerInfo.methods[r.Method]; ok {
|
||||||
isRunnable = true
|
isRunnable = true
|
||||||
|
Loading…
Reference in New Issue
Block a user