Skip to content

fix: match Cache-Control no-transform directive case-insensitively - #286

Open
vaibhavmashal wants to merge 1 commit into
expressjs:masterfrom
vaibhavmashal:fix/cache-control-no-transform-case-insensitive
Open

fix: match Cache-Control no-transform directive case-insensitively#286
vaibhavmashal wants to merge 1 commit into
expressjs:masterfrom
vaibhavmashal:fix/cache-control-no-transform-case-insensitive

Conversation

@vaibhavmashal

Copy link
Copy Markdown

Fixes #284

Per RFC 9111 Section 5.2, Cache-Control directives are compared case-insensitively. Previously, \compression\ checked for
o-transform\ case-sensitively, so headers like \Cache-Control: No-Transform\ or \Cache-Control: NO-TRANSFORM\ were not recognized and responses were still compressed.

Changes

  • Added the case-insensitive flag /i\ to \cacheControlNoTransformRegExp\ in \index.js.
  • Added unit tests in \ est/compression.js\ ensuring that different casings of
    o-transform\ prevent compression.

Copilot AI lite review requested due to automatic review settings August 31, 2026 16:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cache-Control no-transform directive is matched case-sensitively

2 participants