491238ce by MrLee.Kun

Don't overwrite the params from function ValidRouter

just add new params to context.Input.Params
1 parent d9bb1a35
...@@ -612,10 +612,9 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) ...@@ -612,10 +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 { 615 for k, v := range p {
616 p[k] = v 616 context.Input.Params[k] = v
617 } 617 }
618 context.Input.Params = p
619 filterR.filterFunc(context) 618 filterR.filterFunc(context)
620 if filterR.returnOnOutput && w.started { 619 if filterR.returnOnOutput && w.started {
621 return true 620 return true
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!