Skip to content

Commit 877c8fd

Browse files
committed
Attempting to re-fix the Wikipedia bug
This was svn commit r203 in the 0.2.2 branch, which went missing during the transition to git :(.
1 parent 8cf8b4e commit 877c8fd

2 files changed

Lines changed: 15 additions & 10 deletions

File tree

‎src/chrome/content/code/HTTPS.js‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ const HTTPS = {
3737
},
3838

3939
replaceChannel: function(channel) {
40+
var uri = HTTPSRules.rewrittenURI(channel.URI);
41+
if (!uri) {
42+
HTTPS.log(INFO,
43+
"Got replace channel with no applicable rules for URI "
44+
+ channel.URI.spec);
45+
return;
46+
}
4047

4148
var c2=channel.QueryInterface(CI.nsIHttpChannel);
4249
this.log(DBUG,"Redirection limit is " + c2.redirectionLimit);
@@ -73,13 +80,6 @@ const HTTPS = {
7380
return;
7481
}
7582
} catch(e) {}
76-
var uri = HTTPSRules.rewrittenURI(channel.URI);
77-
if (!uri) {
78-
HTTPS.log(INFO,
79-
"Got replace channel with no applicable rules for URI "
80-
+ channel.URI.spec);
81-
return;
82-
}
8383
new ChannelReplacement(channel, uri).replace(true).open();
8484
});
8585
return true;

‎src/components/https-everywhere.js‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ HTTPSEverywhere.prototype = {
254254
return;
255255
}
256256

257-
HTTPS.forceChannel(newChannel);
257+
HTTPS.replaceChannel(newChannel);
258258

259259
// if (HTTPS.forceURI(uri.clone())) {
260260
// if (!HTTPS.replaceChannel(newChannel)) {
@@ -279,8 +279,13 @@ HTTPSEverywhere.prototype = {
279279
// to "should this load?", but also allow us to change the thing.
280280

281281
shouldLoad: function(aContentType, aContentLocation, aRequestOrigin, aContext, aMimeTypeGuess, aInternalCall) {
282-
if (aContentType == 11)
283-
this.log(DBUG, "shouldLoad: "+aContentLocation.spec);
282+
if (aContentType == 11) {
283+
try {
284+
this.log(DBUG, "shouldLoad: "+aContentLocation.spec);
285+
} catch(e) {
286+
this.log(DBUG,"shouldLoad exception");
287+
}
288+
}
284289
var unwrappedLocation = IOUtil.unwrapURL(aContentLocation);
285290
var scheme = unwrappedLocation.scheme;
286291
var isHTTP = /^https?$/.test(scheme); // s? -> either http or https

0 commit comments

Comments
 (0)