mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2025-01-18 04:01:35 +00:00
fix(parse-http): ignore announcements from peers with invalid announcement ports. (#513)
This commit is contained in:
parent
ea1e78e1de
commit
fe75272d51
@ -22,7 +22,7 @@ export default function (req, opts) {
|
||||
params.peer_id = bin2hex(params.peer_id)
|
||||
|
||||
params.port = Number(params.port)
|
||||
if (!params.port) throw new Error('invalid port')
|
||||
if (!params.port || params.port <= 0 || params.port > 65535) throw new Error('invalid port')
|
||||
|
||||
params.left = Number(params.left)
|
||||
if (Number.isNaN(params.left)) params.left = Infinity
|
||||
|
Loading…
Reference in New Issue
Block a user