mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 14:50:55 +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:
parent
9776bb8a03
commit
ea513002c5
12
router.go
12
router.go
@ -844,6 +844,18 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
|
||||
}
|
||||
|
||||
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
|
||||
if EnableAdmin {
|
||||
timeend := time.Since(starttime)
|
||||
|
Loading…
Reference in New Issue
Block a user