Fix Reject Hosts parsing

This commit is contained in:
SukkaW
2022-12-26 18:56:25 +08:00
parent b57ca9c7fe
commit aeb33a169f
3 changed files with 9 additions and 1 deletions

View File

@@ -6,6 +6,10 @@ module.exports.isDomainLoose = (domain) => {
};
module.exports.normalizeDomain = (domain) => {
if (domain == null) {
return null;
}
const { isIcann, isPrivate, hostname, isIp } = parse(domain, { allowPrivateDomains: true });
if (isIp) {
return null;