context: redirect should writer to response instantly
Showing
1 changed file
with
1 additions
and
1 deletions
| ... | @@ -49,7 +49,7 @@ type Context struct { | ... | @@ -49,7 +49,7 @@ type Context struct { |
| 49 | // It sends http response header directly. | 49 | // It sends http response header directly. |
| 50 | func (ctx *Context) Redirect(status int, localurl string) { | 50 | func (ctx *Context) Redirect(status int, localurl string) { |
| 51 | ctx.Output.Header("Location", localurl) | 51 | ctx.Output.Header("Location", localurl) |
| 52 | ctx.Output.SetStatus(status) | 52 | ctx.ResponseWriter.WriteHeader(status) |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | // Abort stops this request. | 55 | // Abort stops this request. | ... | ... |
-
Please register or sign in to post a comment