Skip to content

Commit e4eb9d1

Browse files
authored
Merge pull request #139 from bsyk/allowlisting
Check in allowlist for parent domains
2 parents c8fbfef + cf0f822 commit e4eb9d1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cf_list_create.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,13 @@ await readFile(resolve(`./${blocklistFilename}`), (line, rl) => {
9797
// because we are blocking all subdomains
9898
// Example: fourth.third.example.com => ["example.com", "third.example.com", "fourth.third.example.com"]
9999
for (const item of extractDomain(domain).slice(1)) {
100+
// Check for any higher level domain matches in the allowlist
101+
if (allowlist.has(item)) {
102+
if (DEBUG) console.log(`Found parent domain ${item} in allowlist - Skipping ${domain}`);
103+
allowedDomainCount++;
104+
return;
105+
}
106+
100107
if (!blocklist.has(item)) continue;
101108

102109
// The higher-level domain is already blocked

0 commit comments

Comments
 (0)