2af0c569 by MrLee.Kun

The last filterFunc with returnOnOutput=ture won't be executed

ex:
	beego.InsertFilter("/*", beego.BeforeExec, FilterLoginCheck1,false)
	beego.InsertFilter("/*", beego.BeforeExec, FilterLoginCheck2)

In function  FilterLoginCheck1 , I'll write data via ResponseWriter, and w.started = true
FilterLoginCheck2 won't be executed, it should be.
1 parent 27b7a8f7
...@@ -611,9 +611,6 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) ...@@ -611,9 +611,6 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
611 if p.enableFilter { 611 if p.enableFilter {
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 filterR.returnOnOutput && w.started {
615 return true
616 }
617 if ok, params := filterR.ValidRouter(urlPath); ok { 614 if ok, params := filterR.ValidRouter(urlPath); ok {
618 for k, v := range params { 615 for k, v := range params {
619 context.Input.Params[k] = v 616 context.Input.Params[k] = v
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!