Allow non-wildcard exceptions (no migration or interface yet)

This commit is contained in:
ilyaigpetrov 2021-01-12 15:46:32 +00:00
parent 38e2bb2f3c
commit df3ea9e6ad

View File

@ -298,7 +298,7 @@
self.included = []; self.included = [];
self.excluded = []; self.excluded = [];
for(const host of Object.keys(self.exceptions)) { for(const host of Object.keys(self.exceptions)) {
if (self.exceptions[host]) { if (self.exceptions[host]?.ifIncluded) {
self.included.push(host); self.included.push(host);
} else { } else {
self.excluded.push(host); self.excluded.push(host);
@ -390,7 +390,7 @@
if (pacMods.ifProxyMoreDomains) { if (pacMods.ifProxyMoreDomains) {
finalExceptions = pacMods.moreDomains.reduce((acc, tld) => { finalExceptions = pacMods.moreDomains.reduce((acc, tld) => {
acc[tld] = true; acc[tld] = { ifIncluded: true, ifWild: true };
return acc; return acc;
}, finalExceptions); }, finalExceptions);
@ -406,7 +406,7 @@
/******/ /* EXCEPTIONS START */ /******/ /* EXCEPTIONS START */
/******/ const dotHost = '.' + host; /******/ const dotHost = '.' + host;
/******/ const isHostInDomain = (domain) => dotHost.endsWith('.' + domain); /******/ const isHostInDomain = (domain) => dotHost.endsWith('.' + domain);
/******/ const domainReducer = (maxWeight, [domain, ifIncluded]) => { /******/ const domainReducer = (maxWeight, [domain, { ifIncluded, ifWild }]) => {
/******/ /******/
/******/ if (!isHostInDomain(domain)) { /******/ if (!isHostInDomain(domain)) {
/******/ return maxWeight; /******/ return maxWeight;