Let filter function get more params info from ctx.Input.Params
Showing
1 changed file
with
3 additions
and
0 deletions
| ... | @@ -612,6 +612,9 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) | ... | @@ -612,6 +612,9 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) |
| 612 | if l, ok := p.filters[pos]; ok { | 612 | if l, ok := p.filters[pos]; ok { |
| 613 | for _, filterR := range l { | 613 | for _, filterR := range l { |
| 614 | if ok, p := filterR.ValidRouter(urlPath); ok { | 614 | if ok, p := filterR.ValidRouter(urlPath); ok { |
| 615 | for k, v := range context.Input.Params { | ||
| 616 | p[k] = v | ||
| 617 | } | ||
| 615 | context.Input.Params = p | 618 | context.Input.Params = p |
| 616 | filterR.filterFunc(context) | 619 | filterR.filterFunc(context) |
| 617 | if filterR.returnOnOutput && w.started { | 620 | if filterR.returnOnOutput && w.started { | ... | ... |
-
Please register or sign in to post a comment