Commit f32392e9 authored by tinyproxy's avatar tinyproxy

net/http will do it better

parent 88c5dfa6
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment