Skip to content

Commit 9d9893a

Browse files
committed
parse params.left = 0 properly
1 parent 3a0fec0 commit 9d9893a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/server/parse-http.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ function parseHttpRequest (req, opts) {
2424
params.port = Number(params.port)
2525
if (!params.port) throw new Error('invalid port')
2626

27-
params.left = Number(params.left) || Infinity
27+
params.left = Number(params.left)
28+
if (isNaN(params.left)) params.left = Infinity
29+
2830
params.compact = Number(params.compact) || 0
2931
params.numwant = Math.min(
3032
Number(params.numwant) || common.DEFAULT_ANNOUNCE_PEERS,

0 commit comments

Comments
 (0)