From d29367a4a04390ff32c3f96cbcd626f9e971ab21 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Mon, 24 Aug 2015 00:11:21 +0200 Subject: [PATCH] if server.close() is called, end http response object --- server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.js b/server.js index d6f1bb2..a13718c 100644 --- a/server.js +++ b/server.js @@ -221,7 +221,7 @@ Server.prototype.onHttpRequest = function (req, res, opts) { 'failure reason': err.message } } - if (self.destroyed) return + if (self.destroyed) return res.end() delete response.action // only needed for UDP encoding res.end(bencode.encode(response))