mirror of
https://github.com/logos-storage/bittorrent-tracker.git
synced 2026-01-23 23:23:12 +00:00
server parseHttpRequest(): simplify info_hash checking
This commit is contained in:
parent
217bcf7de5
commit
c97e4236f4
@ -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
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user