mirror of
https://github.com/SukkaW/Surge.git
synced 2026-02-02 03:51:53 +08:00
Fix: enable domain check for some reject data source
This commit is contained in:
@@ -3,6 +3,7 @@ import { createCache } from './cache-apply';
|
||||
import type { PublicSuffixList } from '@gorhill/publicsuffixlist';
|
||||
|
||||
const cache = createCache('cached-tld-parse', true);
|
||||
const cache2 = createCache('cached-tld-parse2', true);
|
||||
|
||||
const sharedConfig = { allowPrivateDomains: true };
|
||||
const sharedConfig2 = { allowPrivateDomains: true, detectIp: false };
|
||||
@@ -10,7 +11,7 @@ const sharedConfig2 = { allowPrivateDomains: true, detectIp: false };
|
||||
/** { allowPrivateDomains: true } */
|
||||
export const parse = (domain: string) => cache.sync(domain, () => tldts.parse(domain, sharedConfig));
|
||||
/** { allowPrivateDomains: true, detectIp: false } */
|
||||
export const parse2 = (domain: string) => cache.sync(domain, () => tldts.parse(domain, sharedConfig2));
|
||||
export const parse2 = (domain: string) => cache2.sync(domain, () => tldts.parse(domain, sharedConfig2));
|
||||
|
||||
let gothillGetDomainCache: ReturnType<typeof createCache> | null = null;
|
||||
export const createCachedGorhillGetDomain = (gorhill: PublicSuffixList) => {
|
||||
|
||||
Reference in New Issue
Block a user