mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 21:58:48 +02:00
http: don't destroy completed request
Calling destroy() on a completed ClientRequest, i.e. once 'close' will be emitted should be a noop. Also before emitting 'close' destroyed === true. Fixes: https://github.com/nodejs/node/issues/32851 PR-URL: https://github.com/nodejs/node/pull/33120 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit is contained in:
parent
8a6fab02ad
commit
b04e88439a
10 changed files with 60 additions and 5 deletions
|
@ -41,6 +41,7 @@ server.listen(0, options.host, function() {
|
|||
// This space intentionally left blank
|
||||
});
|
||||
req.on('close', function() {
|
||||
assert.strictEqual(req.destroyed, true);
|
||||
server.close();
|
||||
});
|
||||
function destroy() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue