1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-26 02:51:28 +00:00

net/http will do it better

This commit is contained in:
tinyproxy 2016-05-21 15:19:21 +08:00
parent 88c5dfa6ea
commit f32392e956

View File

@ -70,10 +70,8 @@ func (ctx *Context) Reset(rw http.ResponseWriter, r *http.Request) {
} }
// Redirect does redirection to localurl with http header status code. // Redirect does redirection to localurl with http header status code.
// It sends http response header directly.
func (ctx *Context) Redirect(status int, localurl string) { func (ctx *Context) Redirect(status int, localurl string) {
ctx.Output.Header("Location", localurl) http.Redirect(ctx.ResponseWriter, ctx.Request, localurl, status)
ctx.ResponseWriter.WriteHeader(status)
} }
// Abort stops this request. // Abort stops this request.