1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-25 18:10:55 +00:00

Merge pull request #1956 from gitchs/master

Ctx.Redirect patch
This commit is contained in:
astaxie 2016-05-23 13:50:59 +08:00
commit cef91db28e

View File

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