mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-12 01:00:34 +08:00
Fix: reject whitelist
This commit is contained in:
parent
16767b6564
commit
65d78b3915
@ -129,6 +129,14 @@ export const buildRejectDomainSet = task(require.main === module, __filename)(as
|
||||
}
|
||||
});
|
||||
|
||||
// whitelist
|
||||
span.traceChildSync('whitelist', () => {
|
||||
for (const domain of filterRuleWhitelistDomainSets) {
|
||||
rejectOutput.whitelistDomain(domain);
|
||||
rejectExtraOutput.whitelistDomain(domain);
|
||||
}
|
||||
});
|
||||
|
||||
await Promise.all([
|
||||
rejectOutput.done(),
|
||||
rejectExtraOutput.done()
|
||||
|
||||
@ -38,6 +38,11 @@ export abstract class RuleOutput {
|
||||
|
||||
static jsonToLines = (json: unknown): string[] => stringify(json).split('\n');
|
||||
|
||||
whitelistDomain = (domain: string) => {
|
||||
this.domainTrie.whitelist(domain);
|
||||
return this;
|
||||
};
|
||||
|
||||
static domainWildCardToRegex = (domain: string) => {
|
||||
let result = '^';
|
||||
for (let i = 0, len = domain.length; i < len; i++) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user