Skip to content

Commit eae081a

Browse files
committed
Clarificatory comment
When a URI has no username:password, sometimes nsIURI.userPass is false; in other cases trying to read in raises an exception (nice API there ;).
1 parent 8e15fa4 commit eae081a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/chrome/content/code/HTTPSRules.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -352,21 +352,22 @@ const HTTPSRules = {
352352
// newuri attribute and an applied_ruleset attribute (or null if there's
353353
// no rewrite).
354354
var i = 0, userpass_present = false;
355-
var blob = {};
356355
var uri = input_uri;
356+
var blob = {};
357357
blob.newuri = null;
358358

359359
// Rulesets shouldn't try to parse usernames and passwords. If we find
360360
// those, apply the ruleset without them and then add them back.
361+
// When .userPass is absent, sometimes it is false and sometimes trying
362+
// to read it raises an exception (probably depending on the URI type).
361363
try {
362364
if (input_uri.userPass) {
363365
uri = input_uri.clone()
364366
userpass_present = true;
365367
uri.userPass = null;
366-
} else {
367-
this.log(WARN, input_uri.spec + ".userPass is false, there is no API consistency");
368-
}
368+
}
369369
} catch(e) {}
370+
370371
// Get the list of rulesets that target this host
371372
try {
372373
var rs = this.potentiallyApplicableRulesets(uri.host);

0 commit comments

Comments
 (0)