1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-25 23:01:28 +00:00

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.
This commit is contained in:
MrLee.Kun 2015-06-14 01:02:41 +08:00
parent 27b7a8f743
commit 2af0c569a5

View File

@ -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