summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorhackademix2019-12-29 19:39:35 +0100
committerhackademix2019-12-29 19:49:44 +0100
commiteaf3c8376e6a05bd20919e0f08c356982bc6abf8 (patch)
treef0ae4d1b4c8d028ec51bbb30c42dcf20580d2c59 /src/common
parent3bf2aab0526f640555904218972c52c09cfd444c (diff)
downloadnoscript-eaf3c8376e6a05bd20919e0f08c356982bc6abf8.tar.gz
noscript-eaf3c8376e6a05bd20919e0f08c356982bc6abf8.tar.xz
noscript-eaf3c8376e6a05bd20919e0f08c356982bc6abf8.zip
Fixed UNTRUSTED domains accidentally set in "match HTTPS only" mode (issue #126).
Diffstat (limited to 'src/common')
-rw-r--r--src/common/Policy.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/common/Policy.js b/src/common/Policy.js
index 4720532..59c24a4 100644
--- a/src/common/Policy.js
+++ b/src/common/Policy.js
@@ -329,8 +329,12 @@ var {Permissions, Policy, Sites} = (() => {
if (typeof dry.sites === "object" && !(dry.sites instanceof Sites)) {
let {trusted, untrusted, temp, custom} = dry.sites;
let sites = Sites.hydrate(custom);
- for (let key of trusted) sites.set(key, options.TRUSTED);
- for (let key of untrusted) sites.set(key, options.UNTRUSTED);
+ for (let key of trusted) {
+ sites.set(key, options.TRUSTED);
+ }
+ for (let key of untrusted) {
+ sites.set(Sites.toggleSecureDomainKey(key, false), options.UNTRUSTED);
+ }
if (temp) {
let tempPreset = options.TRUSTED.tempTwin;
for (let key of temp) sites.set(key, tempPreset);
@@ -427,7 +431,7 @@ var {Permissions, Policy, Sites} = (() => {
if (perms === this.UNTRUSTED) {
cascade = true;
- Sites.toggleSecureDomainKey(siteKey, false);
+ siteKey = Sites.toggleSecureDomainKey(siteKey, false);
}
if (cascade && !url) {
for (let subMatch; (subMatch = sites.match(siteKey));) {