From 591258aacd1ed17076c9da3faabae1017dee9bb4 Mon Sep 17 00:00:00 2001 From: Gil Pedersen Date: Mon, 29 Jan 2024 22:55:43 +0100 Subject: [PATCH] Don't destroy() after end() --- lib/core.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/core.js b/lib/core.js index 70564ee25..43329536f 100755 --- a/lib/core.js +++ b/lib/core.js @@ -569,8 +569,9 @@ exports = module.exports = internals.Core = class { if (socket.readable) { socket.end(internals.badRequestResponse); } - - socket.destroy(err); + else { + socket.destroy(err); + } }); return; } @@ -581,7 +582,6 @@ exports = module.exports = internals.Core = class { } else { socket.end(internals.badRequestResponse); - socket.destroy(err); } } else {