From ce7c8f9b7d460482726ced2398e782c309fceb66 Mon Sep 17 00:00:00 2001 From: Varun Chawla Date: Sun, 8 Feb 2026 12:37:34 -0800 Subject: [PATCH] refactor: replace magic numbers with named constants in bodyAllowedForStatus 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 --- context.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/context.go b/context.go index d73f59e3..77c728d2 100644 --- a/context.go +++ b/context.go @@ -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