Repository navigation
Conversation
Node 27 changed node:http req.headers to a null-prototype object. Since assert.deepStrictEqual compares prototypes, the whole-header-object assertions in test/proxy-agent.js fail on Node 27. The throw occurs inside the server request handler before the server/proxy are closed, which leaves handles open and hangs the test process until the citgm timeout. Signed-off-by: Matteo Collina <hello@matteocollina.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6122 +/- ##
==========================================
+ Coverage 91.61% 91.66% +0.05%
==========================================
Files 113 113
Lines 44069 44041 -28
==========================================
- Hits 40374 40371 -3
+ Misses 3695 3670 -25 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
agammann
reviewed
Nov 1, 2026
agammann
left a comment
There was a problem hiding this comment.
I ran node --test test/proxy-agent.js on 88e2b2a with Node 24.22.1 on Windows: 43 tests passed. I also used a null-prototype header object as a control: deepStrictEqual(headers, plainObject) fails as described, while deepStrictEqual({ ...headers }, plainObject) passes. All three changed assertions normalize only for comparison, so request headers are left untouched. I did not run Node 27 locally.
This branch has not been deployed
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.
This relates to...
Fixes nodejs/citgm#1227
Rationale
Node 27 changed
node:httpreq.headersto be a null-prototype object. Becauseassert.deepStrictEqualcompares prototypes, the whole-header-object assertions intest/proxy-agent.jsfail on Node 27. The failure is thrown inside the server request handler before the server and proxy are closed, which leaves handles open and hangs the test process until citgm's timeout.Changes
Compare
req.headersas a plain object in the ProxyAgent fetch header assertions.Bug Fixes
ProxyAgent header assertions now pass on Node 27 instead of failing and hanging the test run.
Breaking Changes and Deprecations
N/A
Status