mirror of
https://github.com/astaxie/beego.git
synced 2025-07-06 06:00:18 +00:00
the net/http should set header first,the set http status code and then write the content
This commit is contained in:
@ -607,6 +607,7 @@ func (p *ControllerRegister) ServeHTTP(rw http.ResponseWriter, r *http.Request)
|
||||
)
|
||||
context := p.pool.Get().(*beecontext.Context)
|
||||
context.Reset(rw, r)
|
||||
|
||||
defer p.pool.Put(context)
|
||||
defer p.recoverPanic(context)
|
||||
|
||||
@ -616,8 +617,6 @@ func (p *ControllerRegister) ServeHTTP(rw http.ResponseWriter, r *http.Request)
|
||||
context.Output.Header("Server", BConfig.ServerName)
|
||||
}
|
||||
|
||||
context.Output.Header("Content-Type", "text/html; charset=utf-8")
|
||||
|
||||
var urlPath string
|
||||
if !BConfig.RouterCaseSensitive {
|
||||
urlPath = strings.ToLower(r.URL.Path)
|
||||
|
Reference in New Issue
Block a user