mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-28 17:41:54 +08:00
Fix Reject Hosts parsing
This commit is contained in:
@@ -6,6 +6,10 @@ module.exports.isDomainLoose = (domain) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
module.exports.normalizeDomain = (domain) => {
|
module.exports.normalizeDomain = (domain) => {
|
||||||
|
if (domain == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const { isIcann, isPrivate, hostname, isIp } = parse(domain, { allowPrivateDomains: true });
|
const { isIcann, isPrivate, hostname, isIp } = parse(domain, { allowPrivateDomains: true });
|
||||||
if (isIp) {
|
if (isIp) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ async function processFilterRules (filterRulesUrl, fallbackUrls, includeThirdPar
|
|||||||
&& (!filter.isRegex())
|
&& (!filter.isRegex())
|
||||||
&& (!filter.isFullRegex())
|
&& (!filter.isFullRegex())
|
||||||
) {
|
) {
|
||||||
const hostname = filter.getHostname();
|
const hostname = normalizeDomain(filter.getHostname());
|
||||||
if (hostname) {
|
if (hostname) {
|
||||||
if (filter.isException() || filter.isBadFilter()) {
|
if (filter.isException() || filter.isBadFilter()) {
|
||||||
addToWhiteList(hostname);
|
addToWhiteList(hostname);
|
||||||
@@ -222,6 +222,8 @@ async function processFilterRules (filterRulesUrl, fallbackUrls, includeThirdPar
|
|||||||
if (filter.firstParty()) {
|
if (filter.firstParty()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -571,6 +571,8 @@ t.yesware.com
|
|||||||
.charlestownwyllie.oaklawnnonantum.com
|
.charlestownwyllie.oaklawnnonantum.com
|
||||||
.auwrtou.cn
|
.auwrtou.cn
|
||||||
|
|
||||||
|
.shockynews.com
|
||||||
|
|
||||||
# >> Tracking
|
# >> Tracking
|
||||||
tracking.yorg.app
|
tracking.yorg.app
|
||||||
.taginstall.com
|
.taginstall.com
|
||||||
|
|||||||
Reference in New Issue
Block a user