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

admin filter finish to all router include static file

so if your web is need auth or release the resoure you can writer the
finish filter
This commit is contained in:
astaxie 2013-11-15 21:51:36 +08:00
parent 9776bb8a03
commit ea513002c5

View File

@ -844,6 +844,18 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
} }
Admin: Admin:
if p.enableFilter {
if l, ok := p.filters["Finish"]; ok {
for _, filterR := range l {
if filterR.ValidRouter(r.URL.Path) {
filterR.filterFunc(context)
if w.started {
break
}
}
}
}
}
//admin module record QPS //admin module record QPS
if EnableAdmin { if EnableAdmin {
timeend := time.Since(starttime) timeend := time.Since(starttime)