You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Accept-Encoding: * wildcard is ignored during compression negotiation #193
Per RFC 7231, Accept-Encoding: * means the client accepts any encoding. Currently, CompressionHandler.parseAcceptEncoding treats * as an unknown token with priority 0, so responses to Accept-Encoding: * requests are sent uncompressed.
Reproduction
consthandler=newCompressionHandler({brotli: true});// Client says "I accept any encoding"setupMock('*','text/plain');conststream=handler.createCompressionStream(req,res,largeBody);// Expected: brotli compression stream// Actual: null (no compression applied)
Root Cause
parseAcceptEncoding parses * literally into the encodings list, but createCompressionStream's switch statement only matches br, gzip, and deflate. The * token falls through all cases.
Proposed Fix
Expand * into supported encodings that are not explicitly listed or explicitly rejected (q=0):
Activity
wahajahmed010 commentedon May 28, 2026
Hi! I'd like to work on this issue. Could you please assign it to me? I have a PR open (#196) that addresses this.
Fix: handle Accept-Encoding wildcard (*) per RFC 7231