436f9a74 by astaxie

move session init before static

1 parent f8708d01
...@@ -459,6 +459,12 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) ...@@ -459,6 +459,12 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
459 context.Output = beecontext.NewOutput(rw) 459 context.Output = beecontext.NewOutput(rw)
460 } 460 }
461 461
462 // session init
463 if SessionOn {
464 context.Input.CruSession = GlobalSessions.SessionStart(w, r)
465 defer context.Input.CruSession.SessionRelease()
466 }
467
462 if !utils.InSlice(strings.ToLower(r.Method), HTTPMETHOD) { 468 if !utils.InSlice(strings.ToLower(r.Method), HTTPMETHOD) {
463 http.Error(w, "Method Not Allowed", 405) 469 http.Error(w, "Method Not Allowed", 405)
464 goto Admin 470 goto Admin
...@@ -529,12 +535,6 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) ...@@ -529,12 +535,6 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
529 } 535 }
530 } 536 }
531 537
532 // session init after static file
533 if SessionOn {
534 context.Input.CruSession = GlobalSessions.SessionStart(w, r)
535 defer context.Input.CruSession.SessionRelease()
536 }
537
538 if do_filter(AfterStatic) { 538 if do_filter(AfterStatic) {
539 goto Admin 539 goto Admin
540 } 540 }
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!