mirror of
https://github.com/gin-gonic/gin.git
synced 2026-06-07 04:38:19 +08:00
Add comment for bodyAllowedForStatus to clarify 1xx response handling
This commit is contained in:
parent
762433d85e
commit
68ae08b048
@ -1034,6 +1034,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 {
|
||||||
|
// body isn't allowed for 1xx informational responses
|
||||||
case status >= http.StatusContinue && status <= 199:
|
case status >= http.StatusContinue && status <= 199:
|
||||||
return false
|
return false
|
||||||
case status == http.StatusNoContent:
|
case status == http.StatusNoContent:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user