From c97e4236f4f6a97bded56482072b056a61d374cb Mon Sep 17 00:00:00 2001 From: Astro Date: Thu, 11 Dec 2014 17:07:37 +0100 Subject: [PATCH] server parseHttpRequest(): simplify info_hash checking --- lib/parse_http.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/parse_http.js b/lib/parse_http.js index 0f7a775..85e3519 100644 --- a/lib/parse_http.js +++ b/lib/parse_http.js @@ -44,12 +44,10 @@ function parseHttpRequest (req, options) { if (params.info_hash) { if (!Array.isArray(params.info_hash)) throw new Error('invalid info_hash array') - params.info_hash = params.info_hash.map(function (infoHash) { + params.info_hash.forEach(function (infoHash) { if (infoHash.length !== 20) { throw new Error('invalid info_hash') } - - return infoHash }) }