1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-25 23:01:28 +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 BConfig.RunMode == DEV {
//store router pattern into context
context.Input.SetData("RouterPattern", routerInfo.pattern)
}
if routerInfo.routerType == routerTypeRESTFul {
if _, ok := routerInfo.methods[r.Method]; ok {
isRunnable = true