Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
http: improve writeEarlyHints by avoiding for-of loop
  • Loading branch information
haramj committed Sep 21, 2025
commit 17e98e7fa9b5852a24761c5490328e8933c43cca
4 changes: 3 additions & 1 deletion lib/_http_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,9 @@ ServerResponse.prototype.writeEarlyHints = function writeEarlyHints(hints, cb) {

head += 'Link: ' + link + '\r\n';

for (const key of ObjectKeys(hints)) {
const keys = ObjectKeys(hints);
for (let i = 0; i < keys.length; i++) {
const key = keys[i];
if (key !== 'link') {
head += key + ': ' + hints[key] + '\r\n';
}
Expand Down
Loading