From fbf8461cc7b0f5f17fc0efeb1f437d4773a3cc6d Mon Sep 17 00:00:00 2001 From: StounhandJ Date: Wed, 12 Nov 2025 16:46:23 +0300 Subject: [PATCH] http: treat "x-gzip" as equivalent to "gzip" per RFC 7230 4.2.3 --- options.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/options.go b/options.go index 67607f5..eaa7c28 100644 --- a/options.go +++ b/options.go @@ -242,7 +242,9 @@ func DefaultDecompressHandle(c *gin.Context) { continue } - if trimmedValue != "gzip" { + // A recipient SHOULD consider "x-gzip" to be equivalent to "gzip". + // https://www.rfc-editor.org/rfc/rfc7230#section-4.2.3 + if trimmedValue != "gzip" && trimmedValue != "x-gzip" { // According to RFC 7231, Section 3.1.2.2: // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.2 // An origin server MAY respond with a status code of 415 (Unsupported