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 ruyadorno committed Feb 8, 2021
1 parent f760006 commit 9a9cf1e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/_http_agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,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 9a9cf1e

Please sign in to comment.