1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-06 06:10:18 +00:00

beego/context: Fix ignored Header in case SetStatus has been called before

This commit is contained in:
Christoph Portmann
2014-07-08 23:20:55 +03:00
parent fefd8ddb5b
commit 3bb4d6f013
2 changed files with 13 additions and 1 deletions

View File

@ -762,6 +762,11 @@ Admin:
Info("beego:" + r.URL.Path + " 404" + " +" + timeend.String())
}
}
// Call WriteHeader if status code has been set changed
if context.Output.Status != 0 {
w.writer.WriteHeader(context.Output.Status)
}
}
func (p *ControllerRegistor) recoverPanic(rw http.ResponseWriter, r *http.Request) {