We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 49a3102 commit 4aa8cb7Copy full SHA for 4aa8cb7
src/core.ts
@@ -970,8 +970,8 @@ export const safeJSON = (text: string) => {
970
}
971
};
972
973
-// https://stackoverflow.com/a/19709846
974
-const startsWithSchemeRegexp = new RegExp('^(?:[a-z]+:)?//', 'i');
+// https://url.spec.whatwg.org/#url-scheme-string
+const startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i;
975
const isAbsoluteURL = (url: string): boolean => {
976
return startsWithSchemeRegexp.test(url);
977
0 commit comments