Skip to content

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

Merged
UlisesGascon merged 3 commits into
expressjs:masterfrom
vaibhavmashal:fix/cache-control-no-transform-case-insensitive
Sep 9, 2026
Merged

UlisesGascon merged 3 commits into
expressjs:masterfrom
vaibhavmashal:fix/cache-control-no-transform-case-insensitive

Conversation

@vaibhavmashal

Copy link
Copy Markdown
Contributor

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.

@UlisesGascon UlisesGascon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @vaibhavmashal for helping the project! This change will land in the next release. I refactored a bit the tests and included a small reference on the HISTORY.md

@UlisesGascon
UlisesGascon merged commit 0a76495 into expressjs:master Sep 9, 2026
60 checks passed
@UlisesGascon UlisesGascon mentioned this pull request Sep 9, 2026
meta-codesync Bot pushed a commit to facebook/memlab that referenced this pull request Oct 9, 2026
Summary:
Bumps [[https://github.com/expressjs/compression | compression]] from 1.8.1 to 1.8.2.

== Release notes ==

//Sourced from [[https://github.com/expressjs/compression/releases | compression's releases]].//

> **v1.8.2**
>
> **Important**
>
> - Fix [[https://www.cve.org/CVERecord?id=CVE-2026-87776 | CVE-2026-87776]] ([[GHSA-vc2v-76pw-4v95 | GHSA-vc2v-76pw-4v95]])
>
> **What's Changed**
>
> - chore: add funding to package.json by [[https://github.com/bjohansebas | @​bjohansebas]] in [[expressjs/compression#248 | expressjs/compression#248]]
> - build(deps): bump github/codeql-action from 3.29.2 to 3.29.5 by [[https://github.com/dependabot | @​dependabot]][bot] in [[expressjs/compression#249 | expressjs/compression#249]]
> - build(deps): bump actions/checkout from 4.2.2 to 5.0.0 by [[https://github.com/dependabot | @​dependabot]][bot] in [[expressjs/compression#253 | expressjs/compression#253]]
> - build(deps): bump github/codeql-action from 3.29.7 to 3.29.11 by [[https://github.com/dependabot | @​dependabot]][bot] in [[expressjs/compression#252 | expressjs/compression#252]]
> - build(deps): bump actions/download-artifact from 4.3.0 to 5.0.0 by [[https://github.com/dependabot | @​dependabot]][bot] in [[expressjs/compression#251 | expressjs/compression#251]]
> - build(deps): bump actions/setup-node from 4.4.0 to 6.0.0 by [[https://github.com/dependabot | @​dependabot]][bot] in [[expressjs/compression#261 | expressjs/compression#261]]
> - build(deps): bump github/codeql-action from 3.29.11 to 4.31.2 by [[https://github.com/dependabot | @​dependabot]][bot] in [[expressjs/compression#260 | expressjs/compression#260]]
> - build(deps): bump actions/upload-artifact from 4.6.2 to 5.0.0 by [[https://github.com/dependabot | @​dependabot]][bot] in [[expressjs/compression#259 | expressjs/compression#259]]
> - build(deps): bump actions/download-artifact from 5.0.0 to 6.0.0 by [[https://github.com/dependabot | @​dependabot]][bot] in [[expressjs/compression#258 | expressjs/compression#258]]
> - build(deps): bump coverallsapp/github-action from 2.3.6 to 2.3.7 by [[https://github.com/dependabot | @​dependabot]][bot] in [[expressjs/compression#264 | expressjs/compression#264]]
> - build(deps): bump actions/checkout from 5.0.0 to 6.0.0 by [[https://github.com/dependabot | @​dependabot]][bot] in [[expressjs/compression#263 | expressjs/compression#263]]
> - build(deps): bump github/codeql-action from 4.31.2 to 4.31.5 by [[https://github.com/dependabot | @​dependabot]][bot] in [[expressjs/compression#262 | expressjs/compression#262]]
> - chore: up node version to 25.x in CI by [[https://github.com/imangas | @​imangas]] in [[expressjs/compression#272 | expressjs/compression#272]]
> - doc(package): remove history.md and add readme.md to published files by [[https://github.com/sheplu | @​sheplu]] in [[expressjs/compression#270 | expressjs/compression#270]]
> - Update link to CONTRIBUTING.md by [[https://github.com/krzysdz | @​krzysdz]] in [[expressjs/compression#281 | expressjs/compression#281]]
> - test: run CI on Windows and macOS by [[https://github.com/kilisamemarisaaa | @​kilisamemarisaaa]] in [[expressjs/compression#283 | expressjs/compression#283]]
> - build(deps): bump ossf/scorecard-action from 2.4.2 to 2.4.3 by [[https://github.com/dependabot | @​dependabot]][bot] in [[expressjs/compression#257 | expressjs/compression#257]]
> - build(deps): bump actions/download-artifact from 6.0.0 to 7.0.0 by [[https://github.com/dependabot | @​dependabot]][bot] in [[expressjs/compression#268 | expressjs/compression#268]]
> - build(deps): bump github/codeql-action from 4.31.5 to 4.31.9 by [[https://github.com/dependabot | @​dependabot]][bot] in [[expressjs/compression#265 | expressjs/compression#265]]
> - build(deps): bump actions/setup-node from 6.0.0 to 6.1.0 by [[https://github.com/dependabot | @​dependabot]][bot] in [[expressjs/compression#266 | expressjs/compression#266]]
> - build(deps): bump actions/upload-artifact from 5.0.0 to 6.0.0 by [[https://github.com/dependabot | @​dependabot]][bot] in [[expressjs/compression#267 | expressjs/compression#267]]
> - chore(ci): npm-publish via reusable workflows by [[https://github.com/sheplu | @​sheplu]] in [[expressjs/compression#269 | expressjs/compression#269]]
> - docs: update outdated Brotli note and fix npm install docs URL by [[https://github.com/Vansh1811 | @​Vansh1811]] in [[expressjs/compression#276 | expressjs/compression#276]]
> - fix: match Cache-Control no-transform directive case-insensitively by [[https://github.com/vaibhavmashal | @​vaibhavmashal]] in [[expressjs/compression#286 | expressjs/compression#286]]
> - 1.8.2 by [[https://github.com/UlisesGascon | @​UlisesGascon]] in [[expressjs/compression#287 | expressjs/compression#287]]
>
> **New Contributors**
>
> - [[https://github.com/imangas | @​imangas]] made their first contribution in [[expressjs/compression#272 | expressjs/compression#272]]
> - [[https://github.com/sheplu | @​sheplu]] made their first contribution in [[expressjs/compression#270 | expressjs/compression#270]]
> - [[https://github.com/krzysdz | @​krzysdz]] made their first contribution in [[expressjs/compression#281 | expressjs/compression#281]]
> - [[https://github.com/kilisamemarisaaa | @​kilisamemarisaaa]] made their first contribution in [[expressjs/compression#283 | expressjs/compression#283]]
> - [[https://github.com/Vansh1811 | @​Vansh1811]] made their first contribution in [[expressjs/compression#276 | expressjs/compression#276]]
> - [[https://github.com/vaibhavmashal | @​vaibhavmashal]] made their first contribution in [[expressjs/compression#286 | expressjs/compression#286]]
>
> **Full Changelog**: expressjs/compression@v1.8.1...v1.8.2

== Changelog ==

//Sourced from [[https://github.com/expressjs/compression/blob/master/HISTORY.md | compression's changelog]].//

> **1.8.2**
>
> - Fix [[https://www.cve.org/CVERecord?id=CVE-2026-87776 | CVE-2026-87776]] ([[GHSA-vc2v-76pw-4v95 | GHSA-vc2v-76pw-4v95]])
> - deps: add destroy@1.2.0
> - Match `Cache-Control: no-transform` directive case-insensitively

== Commits ==

- [[expressjs/compression@0f97074 | 0f97074]] 1.8.2 ([[expressjs/compression#287 | #287]])
- [[expressjs/compression@151f63e | 151f63e]] fix: destroy compression stream on response close
- [[expressjs/compression@0a76495 | 0a76495]] fix: match Cache-Control no-transform directive case-insensitively ([[expressjs/compression#286 | #286]])
- [[expressjs/compression@c17b6e5 | c17b6e5]] docs: update outdated Brotli note and fix npm install docs URL ([[expressjs/compression#276 | #276]])
- [[expressjs/compression@112911a | 112911a]] chore(ci): npm-publish via reusable workflows ([[expressjs/compression#269 | #269]])
- [[expressjs/compression@1bf5eb0 | 1bf5eb0]] build(deps): bump actions/upload-artifact from 5.0.0 to 6.0.0 ([[expressjs/compression#267 | #267]])
- [[expressjs/compression@d8fe64d | d8fe64d]] build(deps): bump actions/setup-node from 6.0.0 to 6.1.0 ([[expressjs/compression#266 | #266]])
- [[expressjs/compression@b218ff5 | b218ff5]] build(deps): bump github/codeql-action from 4.31.5 to 4.31.9 ([[expressjs/compression#265 | #265]])
- [[expressjs/compression@8a1cf8e | 8a1cf8e]] build(deps): bump actions/download-artifact from 6.0.0 to 7.0.0 ([[expressjs/compression#268 | #268]])
- [[expressjs/compression@4a19855 | 4a19855]] build(deps): bump ossf/scorecard-action from 2.4.2 to 2.4.3 ([[expressjs/compression#257 | #257]])
- Additional commits viewable in [[expressjs/compression@v1.8.1...v1.8.2 | compare view]]

== Maintainer changes ==

This version was pushed to npm by [[https://www.npmjs.com/~GitHub%20Actions | GitHub Actions]], a new releaser for compression since your current version.

Pull Request resolved: #158

Reviewed By: boujeepossum

Differential Revision: D124273396

Pulled By: JacksonGL

fbshipit-source-id: a646d17d04a803bc8c6850b69908ea7e40549c37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants