Browse Source

Fix: salvaged adgaurd rules should match original domain

SukkaW 1 year ago
parent
commit
0540c1de21
2 changed files with 4 additions and 3 deletions
  1. 2 2
      Build/constants/loose-tldts-opt.ts
  2. 2 1
      Build/lib/parse-filter.ts

+ 2 - 2
Build/constants/loose-tldts-opt.ts

@@ -14,6 +14,6 @@ export const loosTldOptWithPrivateDomains: Parameters<typeof tldts.getSubdomain>
 };
 
 export const normalizeTldtsOpt: Parameters<typeof tldts.getSubdomain>[1] = {
-  allowPrivateDomains: true
-  // detectIp: true
+  allowPrivateDomains: true,
+  detectIp: true
 };

+ 2 - 1
Build/lib/parse-filter.ts

@@ -575,7 +575,8 @@ export function parse($line: string, result: [string, ParseType], allowThirdPart
   }
 
   const domain = normalizeDomain(sliced);
-  if (domain) {
+
+  if (domain && domain === sliced) {
     result[0] = domain;
 
     if (white) {