context: redirect should writer to response instantly

This commit is contained in:
astaxie 2014-08-19 09:48:21 +08:00
parent c4fa17921e
commit 80274684e0
1 changed files with 1 additions and 1 deletions

View File

@ -49,7 +49,7 @@ type Context struct {
// It sends http response header directly.
func (ctx *Context) Redirect(status int, localurl string) {
ctx.Output.Header("Location", localurl)
ctx.Output.SetStatus(status)
ctx.ResponseWriter.WriteHeader(status)
}
// Abort stops this request.