From ac00794fb485bcff176cfada6a3aeb06a8b2128b Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sat, 5 Jul 2014 14:41:46 -0700 Subject: [PATCH] error on missing info hash --- server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index ce5b279..8836822 100644 --- a/server.js +++ b/server.js @@ -116,10 +116,10 @@ Server.prototype._onHttpRequest = function (req, res) { // TODO: detect when required params are missing // TODO: support multiple info_hash parameters as a concatenation of individual requests - var infoHash = bytewiseDecodeURIComponent(params.info_hash).toString('hex') + var infoHash = params.info_hash && bytewiseDecodeURIComponent(params.info_hash).toString('hex') if (!infoHash) { - return error('bittorrent-tracker server only supports announcing one torrent at a time') + return error('missing info hash') } if (s[0] === '/announce' || s[0] === '/') {