1
0
mirror of https://github.com/labstack/echo.git synced 2025-11-29 22:48:07 +02:00

Trailing slash middleware with option to redirect

Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana
2016-04-12 22:39:29 -07:00
parent 6c27cffc66
commit b9aa2181b0
7 changed files with 81 additions and 5 deletions

View File

@@ -183,8 +183,8 @@ func TestContext(t *testing.T) {
rec = test.NewResponseRecorder()
c = NewContext(rq, rec, e)
assert.Equal(t, nil, c.Redirect(http.StatusMovedPermanently, "http://labstack.github.io/echo"))
assert.Equal(t, "http://labstack.github.io/echo", rec.Header().Get(HeaderLocation))
assert.Equal(t, http.StatusMovedPermanently, rec.Status())
assert.Equal(t, "http://labstack.github.io/echo", rec.Header().Get(HeaderLocation))
// Error
rec = test.NewResponseRecorder()