mirror of
https://github.com/SukkaW/Surge.git
synced 2026-02-02 12:01:53 +08:00
Chore: improve reject hosts robustness
This commit is contained in:
@@ -5,8 +5,12 @@ import type { PublicSuffixList } from 'gorhill-publicsuffixlist';
|
||||
const cache = createCache('cached-tld-parse', true);
|
||||
|
||||
const sharedConfig = { allowPrivateDomains: true };
|
||||
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));
|
||||
|
||||
let gothillGetDomainCache: ReturnType<typeof createCache> | null = null;
|
||||
export const createCachedGorhillGetDomain = (gorhill: PublicSuffixList) => {
|
||||
|
||||
Reference in New Issue
Block a user