http: use objects with null prototype in Agent

Fixes: https://github.com/nodejs/node/issues/36364

PR-URL: https://github.com/nodejs/node/pull/36409
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
Michaël Zasso 2020-12-06 14:52:08 +01:00
parent c6c8337402
commit 2ef9a76ece
No known key found for this signature in database
GPG key ID: 770F7A9A5AE15600
9 changed files with 33 additions and 19 deletions

View file

@ -70,8 +70,8 @@ server.listen(0, common.mustCall(() => {
req.on('connect', common.mustCall((res, socket, firstBodyChunk) => {
// Make sure this request got removed from the pool.
const name = `localhost:${server.address().port}`;
assert(!http.globalAgent.sockets.hasOwnProperty(name));
assert(!http.globalAgent.requests.hasOwnProperty(name));
assert(!(name in http.globalAgent.sockets));
assert(!(name in http.globalAgent.requests));
// Make sure this socket has detached.
assert(!socket.ondata);