Commit ea513002 authored by astaxie's avatar 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
parent 9776bb8a
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment