GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: avoid prototype collisions in parseHeaders by mcollina · Pull Request #4923 · nodejs/undici

Conversation

@mcollina

@mcollina mcollina commented Mar 23, 2026

Copy link
Copy Markdown
Member

Fix parseHeaders() for response headers and trailers that shadow Object.prototype.

Adds regression tests.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

peterhirn and IlliaVern reacted with heart emoji
All reactions
  • ❤️ 2 reactions
@mcollina
mcollina requested review from Uzlopak and tsctx March 23, 2026 09:37
@ronag

ronag commented Mar 23, 2026

Copy link
Copy Markdown
Member

Perf impact?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@codecov-commenter

codecov-commenter commented Mar 23, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.94%. Comparing base (feef62b) to head (108e939).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4923      +/-   ##
==========================================
+ Coverage   92.93%   92.94%   +0.01%     
==========================================
  Files         112      112              
  Lines       35711    35709       -2     
==========================================
+ Hits        33188    33191       +3     
+ Misses       2523     2518       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tsctx

tsctx commented Mar 23, 2026

Copy link
Copy Markdown
Member

Perf impact?

  • main
> node ./benchmarks/core/parse-headers.mjs
clk: ~3.21 GHz
cpu: AMD Ryzen 7 8845HS w/ Radeon 780M Graphics
runtime: node 25.8.1 (x64-win32)

benchmark                   avg (min … max) p75 / p99    (min … top 1%)
------------------------------------------- -------------------------------
• parseHeaders
------------------------------------------- -------------------------------
parseHeaders                   6.65 µs/iter   6.72 µs     █  ██
                        (6.20 µs … 7.81 µs)   7.34 µs   ███  ██
                    (609.53  b …   2.59 kb)   2.37 kb █▁████▁█████▁▁▁█▁▁▁▁█

parseHeaders (irregular)       6.80 µs/iter   7.02 µs ██
                        (6.30 µs … 9.27 µs)   7.92 µs ██▂▂
                    (  2.59 kb …   2.60 kb)   2.59 kb ████▆▁▁▁▁▆▁▁▁▆▆▁▆▁▁▁▆
  • this PR
> node ./benchmarks/core/parse-headers.mjs
clk: ~3.23 GHz
cpu: AMD Ryzen 7 8845HS w/ Radeon 780M Graphics
runtime: node 25.8.1 (x64-win32)

benchmark                   avg (min … max) p75 / p99    (min … top 1%)
------------------------------------------- -------------------------------
• parseHeaders
------------------------------------------- -------------------------------
parseHeaders                  16.86 µs/iter  15.00 µs █
                     (14.20 µs … 303.20 µs)  36.40 µs █
                    (648.00  b … 260.46 kb)   5.33 kb █▆▂▁▁▁▂▁▁▁▁▁▂▂▁▁▁▁▁▁▁

parseHeaders (irregular)      17.05 µs/iter  16.79 µs   █     █
                      (15.00 µs … 27.50 µs)  18.01 µs ▅▅█ ▅   █▅  ▅ ▅     ▅
                    (  1.06 kb …   5.06 kb)   4.26 kb ███▁█▁▁▁██▁▁█▁█▁▁▁▁▁█
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mcollina
fix: handle prototype-shadowing response headers
65fcb98
Signed-off-by: Matteo Collina <[email protected]>
@mcollina
mcollina force-pushed the fix-header-prototype-collision branch from 1f12065 to 65fcb98 Compare March 23, 2026 10:28
@mcollina
perf: reduce parseHeaders overhead
108e939
Signed-off-by: Matteo Collina <[email protected]>
@mcollina

mcollina commented Mar 23, 2026

Copy link
Copy Markdown
Member Author

Fixing it.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mcollina

mcollina commented Mar 23, 2026

Copy link
Copy Markdown
Member Author

ptal @tsctx

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mcollina

mcollina commented Mar 23, 2026

Copy link
Copy Markdown
Member Author

Should have no regressions now.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

tsctx
tsctx approved these changes Mar 23, 2026
View reviewed changes

@tsctx tsctx left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The 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 reactions
@mcollina
mcollina merged commit b64e7e4 into main Mar 23, 2026
36 of 37 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@mcollina
mcollina deleted the fix-header-prototype-collision branch March 23, 2026 11:04
@github-actions github-actions Bot mentioned this pull request Mar 24, 2026
[Release] v7.24.6 #4931
Merged
@ronag ronag mentioned this pull request May 19, 2026
Sync high-value bug fixes from upstream undici nxtedition/undici#1
Merged
7 tasks done
@luantaraschi luantaraschi mentioned this pull request Aug 8, 2026
fix(cookies): keep a cookie named __proto__ in getCookies #5663
Merged
3 of 7 tasks
@ronag ronag mentioned this pull request Aug 8, 2026
fix: port remaining applicable upstream fixes (timer guards, dead pool path) nxtedition/undici#68
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@tsctx tsctx tsctx approved these changes
@Uzlopak Uzlopak Awaiting requested review from Uzlopak

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@mcollina @ronag @codecov-commenter @tsctx
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.