Skip to content

Conversation

@haramj
Copy link
Member

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

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/http
  • @nodejs/net

@nodejs-github-botnodejs-github-bot added http Issues or PRs related to the http subsystem. needs-ci PRs that need a full CI run. labels Sep 21, 2025
@haramjharamjforce-pushed the haramjeong-patch-250921 branch from 0760cdf to 17e98e7CompareSeptember 21, 2025 06:10
@haramjharamj changed the title http: Improve writeEarlyHints by avoiding for-of loophttp: improve writeEarlyHints by avoiding for-of loopSep 21, 2025
@codecov
Copy link

codecovbot commented Sep 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.43%. Comparing base (39d7303) to head (17e98e7).
⚠️ Report is 120 commits behind head on main.

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 
Files with missing linesCoverage Δ
lib/_http_server.js97.31% <100.00%> (-0.08%)⬇️

... and 46 files with indirect coverage changes

🚀 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.

@daeyeondaeyeon added request-ci Add this label to start a Jenkins CI on a PR. author ready PRs that have at least one approval, no pending requests for changes, and a CI started. labels Sep 27, 2025
@github-actionsgithub-actionsbot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 27, 2025
@nodejs-github-bot
Copy link
Collaborator

Copy link
Member

@gurgundaygurgunday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@nodejs-github-bot
Copy link
Collaborator

@haramj
Copy link
MemberAuthor

It looks like the CI run for this PR failed due to a flaky test.
Could you please re-run the CI.

@nodejs-github-bot
Copy link
Collaborator

@daeyeondaeyeon added the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 6, 2025
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 6, 2025
@nodejs-github-botnodejs-github-bot merged commit 5b3c4b3 into nodejs:mainOct 6, 2025
64 of 65 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 5b3c4b3

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.httpIssues or PRs related to the http subsystem.needs-ciPRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@haramj@nodejs-github-bot@daeyeon@aduh95@gurgunday