mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-14 02:00:37 +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([
|
await Promise.all([
|
||||||
rejectOutput.done(),
|
rejectOutput.done(),
|
||||||
rejectExtraOutput.done()
|
rejectExtraOutput.done()
|
||||||
|
|||||||
@ -38,6 +38,11 @@ export abstract class RuleOutput {
|
|||||||
|
|
||||||
static jsonToLines = (json: unknown): string[] => stringify(json).split('\n');
|
static jsonToLines = (json: unknown): string[] => stringify(json).split('\n');
|
||||||
|
|
||||||
|
whitelistDomain = (domain: string) => {
|
||||||
|
this.domainTrie.whitelist(domain);
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
static domainWildCardToRegex = (domain: string) => {
|
static domainWildCardToRegex = (domain: string) => {
|
||||||
let result = '^';
|
let result = '^';
|
||||||
for (let i = 0, len = domain.length; i < len; i++) {
|
for (let i = 0, len = domain.length; i < len; i++) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user