mirror of
https://github.com/gin-gonic/gin.git
synced 2026-06-13 00:59:29 +08:00
Merge 597ca7b6079407a2bf77f8e504b0046450fd1bb1 into d7776de7d444935ea4385999711bd6331a98fecb
This commit is contained in:
commit
7f912436d9
@ -6,6 +6,7 @@ coverage:
|
|||||||
default:
|
default:
|
||||||
target: 99%
|
target: 99%
|
||||||
threshold: 99%
|
threshold: 99%
|
||||||
|
informational: true
|
||||||
|
|
||||||
patch:
|
patch:
|
||||||
default:
|
default:
|
||||||
|
|||||||
@ -1058,7 +1058,7 @@ func (c *Context) requestHeader(key string) string {
|
|||||||
// bodyAllowedForStatus is a copy of http.bodyAllowedForStatus non-exported function.
|
// bodyAllowedForStatus is a copy of http.bodyAllowedForStatus non-exported function.
|
||||||
func bodyAllowedForStatus(status int) bool {
|
func bodyAllowedForStatus(status int) bool {
|
||||||
switch {
|
switch {
|
||||||
case status >= 100 && status <= 199:
|
case status >= http.StatusContinue && status <= 199:
|
||||||
return false
|
return false
|
||||||
case status == http.StatusNoContent:
|
case status == http.StatusNoContent:
|
||||||
return false
|
return false
|
||||||
|
|||||||
@ -1033,6 +1033,7 @@ func TestContextGetCookie(t *testing.T) {
|
|||||||
func TestContextBodyAllowedForStatus(t *testing.T) {
|
func TestContextBodyAllowedForStatus(t *testing.T) {
|
||||||
assert.False(t, bodyAllowedForStatus(http.StatusProcessing))
|
assert.False(t, bodyAllowedForStatus(http.StatusProcessing))
|
||||||
assert.False(t, bodyAllowedForStatus(http.StatusNoContent))
|
assert.False(t, bodyAllowedForStatus(http.StatusNoContent))
|
||||||
|
assert.False(t, bodyAllowedForStatus(http.StatusContinue))
|
||||||
assert.False(t, bodyAllowedForStatus(http.StatusNotModified))
|
assert.False(t, bodyAllowedForStatus(http.StatusNotModified))
|
||||||
assert.True(t, bodyAllowedForStatus(http.StatusInternalServerError))
|
assert.True(t, bodyAllowedForStatus(http.StatusInternalServerError))
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user