Skip to content

Commit

Permalink
The last filterFunc with returnOnOutput=ture won't be executed
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
oiooj committed Jun 13, 2015
1 parent 27b7a8f commit 2af0c56
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions router.go
Original file line number Diff line number Diff line change
Expand Up @@ -611,9 +611,6 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
if p.enableFilter {
if l, ok := p.filters[pos]; ok {
for _, filterR := range l {
if filterR.returnOnOutput && w.started {
return true
}
if ok, params := filterR.ValidRouter(urlPath); ok {
for k, v := range params {
context.Input.Params[k] = v
Expand Down

0 comments on commit 2af0c56

Please sign in to comment.