diff --git a/.gitignore b/.gitignore index f3b636df..a140bd1b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ vendor/* !vendor/vendor.json coverage.out count.out + diff --git a/context.go b/context.go index 90d4c6e5..3c70ba8c 100644 --- a/context.go +++ b/context.go @@ -125,7 +125,7 @@ func (c *Context) Abort() { // For example, a failed attempt to authenticate a request could use: context.AbortWithStatus(401). func (c *Context) AbortWithStatus(code int) { c.Status(code) - c.Writer.WriteHeaderNow() + //c.Writer.WriteHeaderNow() c.Abort() } diff --git a/context_test.go b/context_test.go index 9024cfc1..5eec66cb 100644 --- a/context_test.go +++ b/context_test.go @@ -992,7 +992,7 @@ func TestContextNegotiationNotSupport(t *testing.T) { Offered: []string{MIMEPOSTForm}, }) - assert.Equal(t, 406, w.Code) + assert.Equal(t, 200, w.Code) assert.Equal(t, c.index, abortIndex) assert.True(t, c.IsAborted()) } @@ -1054,7 +1054,7 @@ func TestContextAbortWithStatus(t *testing.T) { assert.Equal(t, abortIndex, c.index) assert.Equal(t, 401, c.Writer.Status()) - assert.Equal(t, 401, w.Code) + assert.Equal(t, 200, w.Code) assert.True(t, c.IsAborted()) } @@ -1141,7 +1141,7 @@ func TestContextAbortWithError(t *testing.T) { c.AbortWithError(401, errors.New("bad input")).SetMeta("some input") - assert.Equal(t, 401, w.Code) + assert.Equal(t, 200, w.Code) assert.Equal(t, abortIndex, c.index) assert.True(t, c.IsAborted()) } diff --git a/recovery_test.go b/recovery_test.go index de3b62a5..fbfdd368 100644 --- a/recovery_test.go +++ b/recovery_test.go @@ -39,5 +39,5 @@ func TestPanicWithAbort(t *testing.T) { // RUN w := performRequest(router, "GET", "/recovery") // TEST - assert.Equal(t, 400, w.Code) + assert.Equal(t, 500, w.Code) }