fix: Loosen url validation

This commit is contained in:
Tom Moor
2022-12-11 21:28:09 -05:00
parent 80780eedda
commit 91155295fe
2 changed files with 3 additions and 2 deletions

View File

@@ -67,7 +67,7 @@ export function isUrl(text: string, options?: { requireHostname: boolean }) {
return (
url.protocol !== "" &&
url.pathname.startsWith("//") &&
(url.pathname.startsWith("//") || url.pathname.startsWith("http")) &&
!options?.requireHostname
);
} catch (err) {