4d70b22f by astaxie

Merge pull request #1157 from ziyel/master

Let filter function get more params info from ctx.Input.Params
2 parents 364cacf6 d943d16d
......@@ -612,6 +612,9 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
if l, ok := p.filters[pos]; ok {
for _, filterR := range l {
if ok, p := filterR.ValidRouter(urlPath); ok {
for k, v := range context.Input.Params {
p[k] = v
}
context.Input.Params = p
filterR.filterFunc(context)
if filterR.returnOnOutput && w.started {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!