feat(http): add zstd decompression support#10920
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
1 issue found across 8 files
Confidence score: 3/5
- There is a concrete regression risk in
lib/adapters/http.js: switchingadvertiseZstdAcceptEncodingto direct property access can read inherited prototype values, which may incorrectly advertisezstdon requests. - Because this is a medium-severity (6/10) issue with high confidence (9/10) and user-visible request behavior impact, the merge risk is moderate rather than minimal.
- Pay close attention to
lib/adapters/http.js- restore an own-property check foradvertiseZstdAcceptEncodingto prevent prototype-derived opt-in behavior.
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
jasonsaayman
added a commit
that referenced
this pull request
May 28, 2026
* fix(http): move zstd advertising flag to transitional * sec: add has own prop to the transitional Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> --------- Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Node HTTP adapter support for zstd-compressed responses while keeping
zstdout of the defaultAccept-Encodingheader unless explicitly enabled through transitional config.Linked issue
Changes
transitional.advertiseZstdAcceptEncodingto opt into advertising zstd support.Checklist
index.d.tsandindex.d.cts)Summary by cubic
Adds zstd (Zstandard) decompression to the Node HTTP adapter and gates
zstdadvertising behind a new transitional flag. Defaults unchanged; we only includezstdinAccept-Encodingwhentransitional.advertiseZstdAcceptEncodingis true.Description
Summary of changes
transitional.advertiseZstdAcceptEncoding; remove the oldadvertiseZstdrequest option.Axios; default tofalseindefaults/transitional.js.transitionalbefore reading the flag for security hardening.index.d.ts/index.d.cts), merge rules, and pre-release notes.Reasoning
Additional context
axiosNode adapter; browsers are unaffected.Docs
/docs/andREADME.mdto documenttransitional.advertiseZstdAcceptEncoding, Node-only support, and decompression-bomb guidance.Testing
transitional.advertiseZstdAcceptEncodingand assertzstdis included inAccept-Encodingwhen supported.Semantic version impact
advertiseZstdoption was not part of a released API.Written for commit ecc59c7. Summary will update on new commits. Review in cubic