未验证 提交 0056b92d 编写于 作者: M Ming Deng 提交者: GitHub

Merge pull request #4007 from flycash/fix3949

 Store RouterPattern before filter execute
......@@ -750,19 +750,22 @@ func (p *ControllerRegister) ServeHTTP(rw http.ResponseWriter, r *http.Request)
}
}
//execute middleware filters
if routerInfo != nil {
// store router pattern into context
context.Input.SetData("RouterPattern", routerInfo.pattern)
}
// execute middleware filters
if len(p.filters[BeforeExec]) > 0 && p.execFilter(context, urlPath, BeforeExec) {
goto Admin
}
//check policies
// check policies
if p.execPolicy(context, urlPath) {
goto Admin
}
if routerInfo != nil {
//store router pattern into context
context.Input.SetData("RouterPattern", routerInfo.pattern)
if routerInfo.routerType == routerTypeRESTFul {
if _, ok := routerInfo.methods[r.Method]; ok {
isRunnable = true
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册