From e350ae7c7ea10e92a5c51a886ccd957b1a12afb6 Mon Sep 17 00:00:00 2001 From: Alexander Nyquist Date: Tue, 29 Jul 2014 00:53:56 +0200 Subject: [PATCH] Removed redundancy when redirecting --- context.go | 2 +- render/render.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/context.go b/context.go index ccad913e..069f1265 100644 --- a/context.go +++ b/context.go @@ -249,7 +249,7 @@ func (c *Context) String(code int, format string, values ...interface{}) { // Returns a HTTP redirect to the specific location. func (c *Context) Redirect(location string, code int) { - c.Render(code, render.Redirect, location, code) + c.Render(code, render.Redirect, location) } // Writes some data into the body stream and updates the HTTP code. diff --git a/render/render.go b/render/render.go index b034daeb..293bbf99 100644 --- a/render/render.go +++ b/render/render.go @@ -53,7 +53,7 @@ func (_ jsonRender) Render(w http.ResponseWriter, code int, data ...interface{}) func (_ redirectRender) Render(w http.ResponseWriter, code int, data ...interface{}) error { w.Header().Set("Location", data[0].(string)) - w.WriteHeader(data[1].(int)) + w.WriteHeader(code) return nil }