fix: Fix improper use of url.protocol
This commit is contained in:
1 parent
314aa62828
commit
97ee639d62
1 file changed
+1
-1
@@ -21,7 +21,7 @@ module.exports = {
|
||||
urlValidate: (str) => {
|
||||
try {
|
||||
const url = new URL(str);
|
||||
return `${url.protocol}://${url.host}`;
|
||||
return `${url.protocol}//${url.host}`;
|
||||
} catch (e) {
|
||||
// Parse error
|
||||
throw new Error(`URL ${str} could not be validated.`);
|
||||
|
||||
Reference in new issue
Block a user