Merge pull request #587 from roylou/develop
Write header immediately in AbortWithStatus(), close #585
This commit is contained in:
@ -556,7 +556,6 @@ func TestContextAbortWithStatus(t *testing.T) {
|
||||
c, w, _ := CreateTestContext()
|
||||
c.index = 4
|
||||
c.AbortWithStatus(401)
|
||||
c.Writer.WriteHeaderNow()
|
||||
|
||||
assert.Equal(t, c.index, abortIndex)
|
||||
assert.Equal(t, c.Writer.Status(), 401)
|
||||
@ -607,7 +606,6 @@ func TestContextTypedError(t *testing.T) {
|
||||
func TestContextAbortWithError(t *testing.T) {
|
||||
c, w, _ := CreateTestContext()
|
||||
c.AbortWithError(401, errors.New("bad input")).SetMeta("some input")
|
||||
c.Writer.WriteHeaderNow()
|
||||
|
||||
assert.Equal(t, w.Code, 401)
|
||||
assert.Equal(t, c.index, abortIndex)
|
||||
|
Reference in New Issue
Block a user