Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mustard-mh committed Sep 19, 2022
1 parent 6e8bc02 commit ff07bb7
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/server-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit ff07bb7

Please sign in to comment.