From cd9a8106be47c96136a29da25f2b94636f6615c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Sun, 6 Dec 2020 15:37:02 +0100 Subject: [PATCH] http: do not loop over prototype in Agent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: https://github.com/nodejs/node/issues/36364 PR-URL: https://github.com/nodejs/node/pull/36410 Reviewed-By: Gerhard Stöbich Reviewed-By: Ricky Zhou <0x19951125@gmail.com> --- lib/_http_agent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/_http_agent.js b/lib/_http_agent.js index 875c01b201fb7b..c14492c3c31ece 100644 --- a/lib/_http_agent.js +++ b/lib/_http_agent.js @@ -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,' +