From caed2cfa1e93ef72b1fb23adf11f2acdb37a805a Mon Sep 17 00:00:00 2001 From: hackademix Date: Fri, 24 Aug 2018 02:58:46 +0200 Subject: Fixed Sites.domainImplies() misplaced optimization. --- src/common/Policy.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/common/Policy.js b/src/common/Policy.js index 3c31c71..9afc92e 100644 --- a/src/common/Policy.js +++ b/src/common/Policy.js @@ -29,12 +29,11 @@ var {Permissions, Policy, Sites} = (() => { } static domainImplies(domainKey, site, protocol ="https?") { - if (!site.includes(domainKey)) return false; - if (Sites.isSecureDomainKey(domainKey)) { protocol = "https"; domainKey = Sites.toggleSecureDomainKey(domainKey, false); } + if (!site.includes(domainKey)) return false; try { return new RegExp(`^${protocol}://([^/?#:]+\\.)?${rxQuote(domainKey)}(?:[:/]|$)`) .test(site); -- cgit v1.2.3