fix: normalize url

This commit is contained in:
Han Xiao
2025-03-17 12:07:19 +08:00
parent f9cb542dd0
commit 90b1d39cc6

View File

@@ -19,11 +19,6 @@ export function normalizeUrl(urlString: string, debug = false, options = {
throw new Error('Empty URL'); throw new Error('Empty URL');
} }
if (!/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(urlString)) {
urlString = 'https://' + urlString;
}
const url = new URL(urlString); const url = new URL(urlString);
url.hostname = url.hostname.toLowerCase(); url.hostname = url.hostname.toLowerCase();