summaryrefslogtreecommitdiff
path: root/test/parallel/test-http-connect-req-res.js
diff options
context:
space:
mode:
authorRobert Nagy <ronagy@icloud.com>2020-04-28 19:17:57 +0200
committerAnna Henningsen <anna@addaleax.net>2020-05-09 07:57:45 +0200
commit28e6626ce7020b490438e3ee8a8188a59c5f856f (patch)
tree006e8a7adcb57154214e95a3250f0485c01e4e78 /test/parallel/test-http-connect-req-res.js
parent96faea137e7d591cab5fa15f4c5fd7cb28da35ee (diff)
downloadnode-new-28e6626ce7020b490438e3ee8a8188a59c5f856f.tar.gz
http: set IncomingMessage.destroyed
IncomingMessage is a Readable stream and should properly set the destroyed property. PR-URL: https://github.com/nodejs/node/pull/33131 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Diffstat (limited to 'test/parallel/test-http-connect-req-res.js')
-rw-r--r--test/parallel/test-http-connect-req-res.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/parallel/test-http-connect-req-res.js b/test/parallel/test-http-connect-req-res.js
index 893c621852..cd6e55e089 100644
--- a/test/parallel/test-http-connect-req-res.js
+++ b/test/parallel/test-http-connect-req-res.js
@@ -33,7 +33,10 @@ server.listen(0, common.mustCall(function() {
path: 'example.com:443'
}, common.mustNotCall());
- req.on('close', common.mustCall());
+ assert.strictEqual(req.destroyed, false);
+ req.on('close', common.mustCall(() => {
+ assert.strictEqual(req.destroyed, true);
+ }));
req.on('connect', common.mustCall(function(res, socket, firstBodyChunk) {
console.error('Client got CONNECT request');