diff --git a/context.go b/context.go index a50732b6..f081f6d8 100644 --- a/context.go +++ b/context.go @@ -170,8 +170,9 @@ func (c *Context) NoContent(code int) error { } // Redirect redirects the request using http.Redirect with status code. -func (c *Context) Redirect(code int, url string) { +func (c *Context) Redirect(code int, url string) error { http.Redirect(c.response, c.request, url, code) + return nil } // Error invokes the registered HTTP error handler. Generally used by middleware. diff --git a/context_test.go b/context_test.go index 1fc703fa..39183e63 100644 --- a/context_test.go +++ b/context_test.go @@ -139,7 +139,7 @@ func TestContext(t *testing.T) { // Redirect rec = httptest.NewRecorder() c = NewContext(req, NewResponse(rec), New()) - c.Redirect(http.StatusMovedPermanently, "http://labstack.github.io/echo") + assert.Equal(t, nil, c.Redirect(http.StatusMovedPermanently, "http://labstack.github.io/echo")) // Error rec = httptest.NewRecorder()