diff options
Diffstat (limited to 'data/extensions/https-everywhere@eff.org/chrome/content/code/HTTPS.js')
-rw-r--r-- | data/extensions/https-everywhere@eff.org/chrome/content/code/HTTPS.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/data/extensions/https-everywhere@eff.org/chrome/content/code/HTTPS.js b/data/extensions/https-everywhere@eff.org/chrome/content/code/HTTPS.js index c39a0ef..fda0a30 100644 --- a/data/extensions/https-everywhere@eff.org/chrome/content/code/HTTPS.js +++ b/data/extensions/https-everywhere@eff.org/chrome/content/code/HTTPS.js @@ -30,12 +30,23 @@ const HTTPS = { httpsForcedExceptions: null,
httpsRewrite: null,
- replaceChannel: function(applicable_list, channel) {
+ replaceChannel: function(applicable_list, channel, httpNowhereEnabled) {
var blob = HTTPSRules.rewrittenURI(applicable_list, channel.URI.clone());
- if (null == blob) return false; // no rewrite
+ if (null === blob) {
+ // Abort insecure requests when HTTP Nowhere is on
+ if (httpNowhereEnabled && channel.URI.schemeIs("http")) {
+ IOUtil.abort(channel);
+ }
+ return false; // no rewrite
+ }
var uri = blob.newuri;
if (!uri) this.log(WARN, "OH NO BAD ARGH\nARGH");
+ // Abort downgrading if HTTP Nowhere is on
+ if (httpNowhereEnabled && uri.schemeIs("http")) {
+ IOUtil.abort(channel);
+ }
+
var c2 = channel.QueryInterface(CI.nsIHttpChannel);
this.log(DBUG, channel.URI.spec+": Redirection limit is " + c2.redirectionLimit);
// XXX This used to be (c2.redirectionLimit == 1), but that's very
|