Fix: correctly process phishing domains

This commit is contained in:
SukkaW
2024-01-22 00:06:07 +08:00
parent 725f26b428
commit 41b2f543f8
8 changed files with 6 additions and 13 deletions

View File

@@ -1,6 +1,5 @@
import { getGorhillPublicSuffixPromise } from './get-gorhill-publicsuffix';
import { processDomainLists, processHosts } from './parse-filter';
import { traceAsync, traceSync } from './trace-runner';
import { processDomainLists } from './parse-filter';
import * as tldts from 'tldts';
import { createTrie } from './trie';
import { createCachedGorhillGetDomain } from './cached-tld-parse';
@@ -182,8 +181,8 @@ export const getPhishingDomains = (parentSpan: Span) => parentSpan.traceChild('g
const results = span.traceChild('get final phishing results').traceSyncFn(() => {
const results: string[] = [];
for (const domain in domainCountMap) {
if (domainCountMap[domain] > 5) {
results.push(domain);
if (domainCountMap[domain] >= 5) {
results.push(`.${domain}`);
}
}
return results;