Skip to content

Commit 2d4e416

Browse files
committed
feat: allow implicit 80 target port
1 parent 51cff33 commit 2d4e416

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

src/cli.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,13 @@ const targetPortMatch = (program.target as string).match(
6161
);
6262
const targetPort: string = targetPortMatch !== null ? targetPortMatch[1] : '';
6363

64-
if (!targetPort || isNaN(Number(targetPort))) {
65-
console.log('Did not provide a port number within the target URL.\n');
66-
program.outputHelp();
67-
process.exit();
64+
if (isNaN(Number(targetPort))) {
65+
// Check for implied port numbers
66+
if (!program.target.startsWith('http://')) {
67+
console.log('Did not provide a port number within the target URL.\n');
68+
program.outputHelp();
69+
process.exit();
70+
}
6871
}
6972
if (
7073
program.target.indexOf('//localhost') !== -1 &&

0 commit comments

Comments
 (0)