Skip to content

fix: fall back to gzip when brotli compression is unavailable - #990

Merged
vdusek merged 1 commit into
masterfrom
fix/gzip-fallback-when-brotli-fails
Aug 3, 2026
Merged

fix: fall back to gzip when brotli compression is unavailable#990
vdusek merged 1 commit into
masterfrom
fix/gzip-fallback-when-brotli-fails

Conversation

@vdusek

@vdusek vdusek commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Request compression guarded brotli availability with a typeof brotliCompress === 'function' check, commented as a workaround for Node.js < v10.16.0. That version check has been dead code for a long time, and it does not actually cover the case it was reaching for: a runtime that exports brotliCompress but cannot run it still throws.

Replaced it with a real try/catch around the compression call, keeping the gzip fallback. The behavior is now keyed on compression actually failing rather than on a symbol being present, which also covers runtimes with a partial node:zlib (bundler polyfills, Node compatibility shims). If gzip fails too, compression is skipped instead of failing the request, same as before.

Split out of #984 per this review discussion - it is unrelated to the Node.js version bump.

✍️ Drafted by Claude Code

@vdusek vdusek added adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. labels Aug 3, 2026
@vdusek vdusek self-assigned this Aug 3, 2026
@github-actions github-actions Bot added this to the 146th sprint - Tooling team milestone Aug 3, 2026
@vdusek
vdusek requested a review from B4nan August 3, 2026 10:46
@vdusek
vdusek marked this pull request as ready for review August 3, 2026 10:46
@vdusek
vdusek merged commit 9bee474 into master Aug 3, 2026
7 checks passed
@vdusek
vdusek deleted the fix/gzip-fallback-when-brotli-fails branch August 3, 2026 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants