1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 15:00:54 +00:00

Merge pull request #2248 from smacker/RouterPattern-in-ctx

Add RouterPattern to context.Input
This commit is contained in:
astaxie 2016-10-30 10:48:15 +08:00 committed by GitHub
commit b635af5a8c

View File

@ -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