ea513002 by astaxie

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
1 parent 9776bb8a
Showing 1 changed file with 12 additions and 0 deletions
......@@ -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)
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!