From efa15629dd3ea061a06499e7dbff0e44c133146e Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Fri, 1 May 2015 14:21:09 -0700 Subject: [PATCH] don't reply to http requests after server has stopped listening --- server.js | 1 + 1 file changed, 1 insertion(+) diff --git a/server.js b/server.js index 7644c94..07e41e8 100644 --- a/server.js +++ b/server.js @@ -183,6 +183,7 @@ Server.prototype.onHttpRequest = function (req, res, opts) { 'failure reason': err.message } } + if (!self.listening) return delete response.action // only needed for UDP encoding res.end(bencode.encode(response))