GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||
GeezerVison is showing github.com — fix: keep a header named __proto__ across features by luantaraschi · Pull Request #5688 · nodejs/undici Conversation
Contributor
This relates to...Supersedes #5666, #5667, #5668 and #5669. This is the consolidation you asked for in #5666 (comment) and confirmed in #5667 (comment): one util, used across the features. Thanks for the steer, it turned four near-identical diffs into one. RationaleWriting a header named
ChangesThe guard becomes
Three of those read a header back before writing it, so they now check with Two notes on scope, both easy to change if you see it differently:
#5663 is not part of this and stays as it is. It gives FeaturesN/A Bug FixesA header named Breaking Changes and DeprecationsNone. TestingFive new tests, one per site plus the deduplication key collision. Each of them fails on With the change, on Node 22.20.0 on Windows: Status
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsWriting a header named `__proto__` onto a plain object reaches the Object.prototype setter instead of creating a property. A string value is dropped without a trace, and an array value replaces the accumulator's prototype, which takes every method of that object with it. `parseHeaders` in lib/core/util.js already guarded the case with Object.defineProperty. That guard becomes an exported `setHeader` util and the four remaining accumulators use it: the entries object of the fetch Headers list, the cache key and deduplication key builders, the mock snapshot header normalizers, and the HTTP/2 request header builder. The three accumulators that also read a header back before writing now check with Object.hasOwn, because a plain read resolves `__proto__` through the prototype chain rather than reporting the header as absent.
This was referenced
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
metcoder95
approved these changes
mcollina
approved these changes
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lgtm
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsUh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. 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. | |||||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |