@@ -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