*/
export function normalizeURL(url: string | URI): string {
try {
const parsed = typeof url === 'string' ? URI.parse(url, true) : url;
if (caseInsensitiveAuthorities.includes(parsed.authority)) {
return parsed.with({ path: parsed.path.toLowerCase() }).toString(true);
} else {
return parsed.toString(true);
}
}
const rLocalhost = /^(.+\.)?localhost(:\d+)?$/i;