Context redirect uses the built-in redirect facility

This commit is contained in:
Manu Mtz-Almeida
2015-04-07 12:27:02 +02:00
parent c0e8cedc98
commit 3abeba82fc
2 changed files with 5 additions and 4 deletions

View File

@ -44,8 +44,9 @@ var (
)
func (_ redirectRender) Render(w http.ResponseWriter, code int, data ...interface{}) error {
w.Header().Set("Location", data[0].(string))
w.WriteHeader(code)
req := data[0].(*http.Request)
location := data[1].(string)
http.Redirect(w, req, location, code)
return nil
}