diff --git a/lib/server/parse-http.js b/lib/server/parse-http.js index 9e83a59..24c3c69 100644 --- a/lib/server/parse-http.js +++ b/lib/server/parse-http.js @@ -24,7 +24,9 @@ function parseHttpRequest (req, opts) { params.port = Number(params.port) if (!params.port) throw new Error('invalid port') - params.left = Number(params.left) || Infinity + params.left = Number(params.left) + if (isNaN(params.left)) params.left = Infinity + params.compact = Number(params.compact) || 0 params.numwant = Math.min( Number(params.numwant) || common.DEFAULT_ANNOUNCE_PEERS,