From 65c44e81f78d741d0581cb61878fee00011878f3 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sat, 12 Jul 2014 18:40:52 -0700 Subject: [PATCH] http server: error on invalid peer_id --- server.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server.js b/server.js index 22d6d78..e5fa6be 100644 --- a/server.js +++ b/server.js @@ -133,6 +133,8 @@ Server.prototype._onHttpRequest = function (req, res) { if (!infoHash) return error('invalid info_hash') if (infoHash.length !== 20) return error('invalid info_hash') + if (!peerId) return error('invalid peer_id') + if (peerId.length !== 20) return error('invalid peer_id') if (!port) return error('invalid port') if (!peerId) return error('invalid peer_id')