Chore: minor changes

This commit is contained in:
SukkaW
2024-05-27 02:42:56 +08:00
parent eb0623c1a9
commit efa34399b0
7 changed files with 94 additions and 68 deletions

View File

@@ -7,6 +7,7 @@ export const normalizeDomain = (domain: string) => {
const parsed = tldtsParse(domain, { allowPrivateDomains: true, detectIp: false });
// if (parsed.isIp) return null;
if (!parsed.hostname) return null;
// Private invalid domain (things like .tor, .dn42, etc)
if (!parsed.isIcann && !parsed.isPrivate) return null;
let h = parsed.hostname;