diff --git a/src/server-main.js b/src/server-main.js index 4e806323689d0..27ecbaed0d6af 100644 --- a/src/server-main.js +++ b/src/server-main.js @@ -188,14 +188,10 @@ function sanitizeStringArg(val) { * @throws */ async function parsePort(host, strPort) { - let specificPort; if (strPort) { let range; if (strPort.match(/^\d+$/)) { - specificPort = parseInt(strPort, 10); - if (specificPort === 0) { - return specificPort; - } + return parseInt(strPort, 10); } else if (range = parseRange(strPort)) { const port = await findFreePort(host, range.start, range.end); if (port !== undefined) {