url: re-parse hostname after validating

This commit is contained in:
dumbmoron
2023-12-14 23:14:22 +00:00
parent 34d8333d72
commit ba35ec923e

View File

@@ -48,11 +48,12 @@ export function aliasURL(url) {
break; break;
} }
return { url, host: host.sld } return url
} }
export function cleanURL({ url, host }) { export function cleanURL(url) {
assert(url instanceof URL); assert(url instanceof URL);
const host = psl.parse(url.hostname).sld;
let stripQuery = true; let stripQuery = true;
if (host === 'pinterest') { if (host === 'pinterest') {