mirror of
https://github.com/astaxie/beego.git
synced 2025-07-06 06:00:18 +00:00
beego: improve the static file server
This commit is contained in:
12
router.go
12
router.go
@ -32,7 +32,8 @@ import (
|
||||
|
||||
const (
|
||||
// default filter execution points
|
||||
BeforeRouter = iota
|
||||
BeforeStatic = iota
|
||||
BeforeRouter
|
||||
BeforeExec
|
||||
AfterExec
|
||||
FinishRouter
|
||||
@ -577,6 +578,15 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
|
||||
return false
|
||||
}
|
||||
|
||||
if do_filter(BeforeStatic) {
|
||||
goto Admin
|
||||
}
|
||||
|
||||
serverStaticRouter(context)
|
||||
if w.started {
|
||||
goto Admin
|
||||
}
|
||||
|
||||
// session init
|
||||
if SessionOn {
|
||||
context.Input.CruSession = GlobalSessions.SessionStart(w, r)
|
||||
|
Reference in New Issue
Block a user