From f32392e956316f001e4d7e2e47890d22fc9b2c7a Mon Sep 17 00:00:00 2001 From: tinyproxy Date: Sat, 21 May 2016 15:19:21 +0800 Subject: [PATCH] net/http will do it better --- context/context.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/context/context.go b/context/context.go index 63a1313d..d5226ec0 100644 --- a/context/context.go +++ b/context/context.go @@ -70,10 +70,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.