http: improve writeEarlyHints by avoiding for-of loop#59958
Merged
nodejs-github-bot merged 1 commit intonodejs:mainfrom Oct 6, 2025
Merged
http: improve writeEarlyHints by avoiding for-of loop#59958nodejs-github-bot merged 1 commit intonodejs:mainfrom
nodejs-github-bot merged 1 commit intonodejs:mainfrom
Conversation
Collaborator
|
Review requested:
|
0760cdf to
17e98e7
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #59958 +/- ##
=======================================
Coverage 88.42% 88.43%
=======================================
Files 703 703
Lines 207399 207401 +2
Branches 39986 39992 +6
=======================================
+ Hits 183397 183410 +13
- Misses 15989 15990 +1
+ Partials 8013 8001 -12
🚀 New features to boost your workflow:
|
daeyeon
approved these changes
Sep 27, 2025
Collaborator
aduh95
approved these changes
Sep 28, 2025
Collaborator
Member
Author
|
It looks like the CI run for this PR failed due to a flaky test. |
Collaborator
Collaborator
|
Landed in 5b3c4b3 |
targos
pushed a commit
that referenced
this pull request
Oct 6, 2025
PR-URL: #59958 Refs: https://github.com/nodejs/node/blob/main/doc/contributing/primordials.md#unsafe-array-iteration Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
aduh95
pushed a commit
that referenced
this pull request
Oct 22, 2025
PR-URL: #59958 Refs: https://github.com/nodejs/node/blob/main/doc/contributing/primordials.md#unsafe-array-iteration Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.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.
This change is based on the "Unsafe array iteration" principle from the Node.js core development guidelines. for-of loops rely on the Symbol.iterator property, which can be modified by userland code, potentially leading to unpredictable or insecure behavior. Using a standard for loop directly accesses the array elements by index, ensuring a more stable and secure execution flow.
Refs: https://github.com/nodejs/node/blob/main/doc/contributing/primordials.md#unsafe-array-iteration