Skip to content

Commit c97e423

Browse files
committed
server parseHttpRequest(): simplify info_hash checking
1 parent 217bcf7 commit c97e423

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/parse_http.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,10 @@ function parseHttpRequest (req, options) {
4444
if (params.info_hash) {
4545
if (!Array.isArray(params.info_hash)) throw new Error('invalid info_hash array')
4646

47-
params.info_hash = params.info_hash.map(function (infoHash) {
47+
params.info_hash.forEach(function (infoHash) {
4848
if (infoHash.length !== 20) {
4949
throw new Error('invalid info_hash')
5050
}
51-
52-
return infoHash
5351
})
5452
}
5553

0 commit comments

Comments
 (0)