Skip to content

Commit ed454e7

Browse files
committed
fix: add URL validation check before processing input URL
1 parent 1a20c8b commit ed454e7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/run/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,12 @@ export default async (cmd) => {
123123
return;
124124
}
125125

126+
let urlTest = new URL(cmd.url);
127+
if (!urlTest) {
128+
console.log(chalk.red("[!] Invalid URL"));
129+
return;
130+
}
131+
126132
await processUrl(cmd.url, cmd.output, ".", cmd, false);
127133
} else {
128134
// since this is a file, we need to first load the URLs in the memory remove empty strings

0 commit comments

Comments
 (0)