diff --git a/routes_test.go b/routes_test.go index 7464d5d..41693ee 100644 --- a/routes_test.go +++ b/routes_test.go @@ -439,3 +439,15 @@ func TestRouteRawPathNoUnescape(t *testing.T) { w := performRequest(route, "POST", "/project/Some%2FOther%2FProject/build/333") assert.Equal(t, w.Code, 200) } + +func TestRouteServeErrorWithWriteHeader(t *testing.T) { + route := New() + route.Use(func(c *Context) { + c.Status(421) + c.Next() + }) + + w := performRequest(route, "GET", "/NotFound") + assert.Equal(t, 421, w.Code) + assert.Equal(t, 0, w.Body.Len()) +}