Skip to content

Commit de0a9bd

Browse files
committed
Notify observers about rewrites regardless of which codepath we're on
https://trac.torproject.org/projects/tor/ticket/5682 Conflicts: src/Changelog
1 parent 75c397e commit de0a9bd

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

src/Changelog

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,15 @@ chrome-2012.3.14
7474
* Switch non-US google searches to country sites by default
7575
* Better chrome context UI
7676

77+
2.0.4 (2012-05-08)
78+
* Fix for compatibility with some other Firefox extensions:
79+
https://trac.torproject.org/projects/tor/ticket/5682
80+
* Fixes: Wordpress stylesheets, USENIX, Mozilla
81+
https://mail1.eff.org/pipermail/https-everywhere-rules/2012-April/001105.html
82+
* Disable broken: Pandora, Miranda IM, Pastebin.ca
83+
https://trac.torproject.org/projects/tor/ticket/5804
84+
https://trac.torproject.org/projects/tor/ticket/5776
85+
7786
2.0.3 (2012-04-26)
7887

7988
* Fix a downgrade attack that might allow attackers to deny HTTPS

src/chrome/content/code/HTTPS.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,11 @@ const HTTPS = {
3232

3333
replaceChannel: function(applicable_list, channel) {
3434
var blob = HTTPSRules.rewrittenURI(applicable_list, channel.URI);
35-
if (null == blob) {
36-
//HTTPS.log(INFO,
37-
// "Got replace channel with no applicable rules for URI "
38-
// + channel.URI.spec);
39-
return false;
40-
}
35+
if (null == blob) return false; // no rewrite
4136
var uri = blob.newuri;
4237
if (!uri) this.log(WARN, "OH NO BAD ARGH\nARGH");
4338

44-
var c2=channel.QueryInterface(CI.nsIHttpChannel);
39+
var c2 = channel.QueryInterface(CI.nsIHttpChannel);
4540
this.log(DBUG,"Redirection limit is " + c2.redirectionLimit);
4641
// XXX This used to be (c2.redirectionLimit == 1), but that's very
4742
// inefficient in a case (eg amazon) where this may happen A LOT.
@@ -58,6 +53,7 @@ const HTTPS = {
5853
return false;
5954
}
6055
if (ChannelReplacement.supported) {
56+
HTTPSEverywhere.instance.notifyObservers(channel.URI, uri.spec);
6157
HTTPS.log(INFO,"Scheduling channel replacement for "+channel.URI.spec);
6258
ChannelReplacement.runWhenPending(channel, function() {
6359
var cr = new ChannelReplacement(channel, uri);
@@ -77,7 +73,6 @@ const HTTPS = {
7773
// Strategy 1: replace the parts of the old_uri piecewise. Often this
7874
// works. In some cases it doesn't.
7975
this.log(NOTE,"Rewriting " + old_uri.spec + " -> " + new_uri.spec + "\n");
80-
HTTPSEverywhere.instance.notifyObservers(old_uri, new_uri.spec);
8176

8277
old_uri.scheme = new_uri.scheme;
8378
old_uri.userPass = new_uri.userPass;
@@ -131,6 +126,7 @@ const HTTPS = {
131126
var newuri = blob.newuri;
132127

133128
try {
129+
HTTPSEverywhere.instance.notifyObservers(uri, newuri.spec);
134130
if (this.rewriteInPlace(uri, newuri))
135131
this.log(INFO,"Forced URI " + uri.spec);
136132
return true;

0 commit comments

Comments
 (0)