Skip to content

Commit

Permalink
http: do not loop over prototype in Agent
Browse files Browse the repository at this point in the history
Fixes: #36364

PR-URL: #36410
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
  • Loading branch information
targos authored and BethGriggs committed Feb 8, 2021
1 parent 20b1e6c commit 017eed6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/_http_agent.js
Expand Up @@ -435,7 +435,7 @@ Agent.prototype.removeSocket = function removeSocket(s, options) {
// There might be older requests in a different origin, but
// if the origin which releases the socket has pending requests
// that will be prioritized.
for (const prop in this.requests) {
for (const prop of ObjectKeys(this.requests)) {
// Check whether this specific origin is already at maxSockets
if (this.sockets[prop] && this.sockets[prop].length) break;
debug('removeSocket, have a request with different origin,' +
Expand Down

0 comments on commit 017eed6

Please sign in to comment.