diff --git a/context.go b/context.go index a00d1e55..4c71a15b 100644 --- a/context.go +++ b/context.go @@ -1056,6 +1056,7 @@ func (c *Context) requestHeader(key string) string { /************************************/ // bodyAllowedForStatus is a copy of http.bodyAllowedForStatus non-exported function. +// Use http.StatusContinue constant for better code clarity func bodyAllowedForStatus(status int) bool { switch { case status >= http.StatusContinue && status < http.StatusOK: diff --git a/context_test.go b/context_test.go index 41694585..408b45bc 100644 --- a/context_test.go +++ b/context_test.go @@ -1033,6 +1033,7 @@ func TestContextGetCookie(t *testing.T) { func TestContextBodyAllowedForStatus(t *testing.T) { assert.False(t, bodyAllowedForStatus(http.StatusProcessing)) assert.False(t, bodyAllowedForStatus(http.StatusNoContent)) + assert.False(t, bodyAllowedForStatus(http.StatusContinue)) assert.False(t, bodyAllowedForStatus(http.StatusNotModified)) assert.True(t, bodyAllowedForStatus(http.StatusInternalServerError)) }