mirror of
https://github.com/gin-gonic/gin.git
synced 2026-04-11 14:11:46 +08:00
refactor: replace magic numbers with named constants in bodyAllowedForStatus (#4529)
Use http.StatusContinue and http.StatusOK instead of hardcoded 100 and 199 for the 1xx informational status range check, consistent with the pattern already used in logger.go. Fixes #4489
This commit is contained in:
parent
8e07d37c63
commit
488f8c3ffa
@ -1058,7 +1058,7 @@ func (c *Context) requestHeader(key string) string {
|
||||
// bodyAllowedForStatus is a copy of http.bodyAllowedForStatus non-exported function.
|
||||
func bodyAllowedForStatus(status int) bool {
|
||||
switch {
|
||||
case status >= 100 && status <= 199:
|
||||
case status >= http.StatusContinue && status < http.StatusOK:
|
||||
return false
|
||||
case status == http.StatusNoContent:
|
||||
return false
|
||||
|
||||
Loading…
Reference in New Issue
Block a user