Skip to content

Commit 9fbb9c2

Browse files
committed
Merge pull request EFForg#1341 from semenko/chrome-nits
[Chrome] A few cleanup nits
2 parents 4a6c0d3 + dd26689 commit 9fbb9c2

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

chromium/background.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"use strict";
12
/**
23
* Fetch and parse XML to be loaded as RuleSets.
34
*/

chromium/rules.js

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ RuleSet.prototype = {
4545
return null;
4646
}
4747
}
48-
// If a rulset has a match_rule and it fails, go no further
48+
// If a ruleset has a match_rule and it fails, go no further
4949
if (this.ruleset_match_c && !this.ruleset_match_c.test(urispec)) {
5050
log(VERB, "ruleset_match_c excluded " + urispec);
5151
return null;
@@ -290,24 +290,15 @@ RuleSets.prototype = {
290290
// If we passed that test, make up a random URL on the domain, and see if
291291
// we would HTTPSify that.
292292

293-
try {
294-
var nonce_path = "/" + Math.random().toString();
295-
nonce_path = nonce_path + nonce_path;
296-
var test_uri = "http://" + domain + nonce_path;
297-
} catch (e) {
298-
log(WARN, "explosion in safeToSecureCookie for " + domain + "\n"
299-
+ "(" + e + ")");
300-
this.cookieHostCache.set(domain, false);
301-
return false;
302-
}
293+
var nonce_path = "/" + Math.random().toString();
294+
var test_uri = "http://" + domain + nonce_path + nonce_path;
303295

304296
log(INFO, "Testing securecookie applicability with " + test_uri);
305297
var rs = this.potentiallyApplicableRulesets(domain);
306298
for (var i = 0; i < rs.length; ++i) {
307299
if (!rs[i].active) continue;
308-
var rewrite = rs[i].apply(test_uri);
309-
if (rewrite) {
310-
log(INFO, "Cookie domain could be secured: " + rewrite);
300+
if (rs[i].apply(test_uri)) {
301+
log(INFO, "Cookie domain could be secured.");
311302
this.cookieHostCache.set(domain, true);
312303
return true;
313304
}

0 commit comments

Comments
 (0)