summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2020-12-06 15:37:02 +0100
committerRuy Adorno <ruyadorno@hotmail.com>2021-02-09 22:14:21 -0500
commitcd9a8106be47c96136a29da25f2b94636f6615c2 (patch)
tree4282976b8070e22f7b496baab234de06889e060e
parente8a4e560ead42143195056fba141d8a36bc3e1b7 (diff)
downloadnode-new-cd9a8106be47c96136a29da25f2b94636f6615c2.tar.gz
http: do not loop over prototype in Agent
Fixes: https://github.com/nodejs/node/issues/36364 PR-URL: https://github.com/nodejs/node/pull/36410 Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
-rw-r--r--lib/_http_agent.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/_http_agent.js b/lib/_http_agent.js
index 875c01b201..c14492c3c3 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,' +