Skip to content

Commit cd9a810

Browse files
targosruyadorno
authored andcommitted
http: do not loop over prototype in Agent
Fixes: #36364 PR-URL: #36410 Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Ricky Zhou <[email protected]>
1 parent e8a4e56 commit cd9a810

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/_http_agent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ Agent.prototype.removeSocket = function removeSocket(s, options) {
428428
// There might be older requests in a different origin, but
429429
// if the origin which releases the socket has pending requests
430430
// that will be prioritized.
431-
for (const prop in this.requests) {
431+
for (const prop of ObjectKeys(this.requests)) {
432432
// Check whether this specific origin is already at maxSockets
433433
if (this.sockets[prop] && this.sockets[prop].length) break;
434434
debug('removeSocket, have a request with different origin,' +

0 commit comments

Comments
 (0)