@@ -92,13 +92,17 @@ def test_unescaped_dots_in_exclusion(tree, rulename, from_attrib, to):
9292 return True
9393
9494xpath_rule = etree .XPath ("/ruleset/rule" )
95+ xpath_ruleset_platform = etree .XPath ("/ruleset/@platform" )
96+ xpath_ruleset_default_off = etree .XPath ("/ruleset/@default_off" )
9597def test_unencrypted_to (tree , rulename , from_attrib , to ):
9698 # Rules that redirect to something other than https or http.
9799 # This used to test for http: but testing for lack of https: will
98100 # catch more kinds of mistakes.
99101 # Now warn if the rule author indicates they intended it, with the
100102 # downgrade attribute. Error if this attribute is not present.
101103 """Rule redirects to something other than https."""
104+ if len (xpath_ruleset_platform (tree )) != 0 or len (xpath_ruleset_default_off (tree )) != 0 :
105+ return True
102106 for rule in xpath_rule (tree ):
103107 to , downgrade = rule .get ("to" ), rule .get ("downgrade" )
104108 if to [:6 ] != "https:" and to [:5 ] != "http:" :
@@ -158,7 +162,6 @@ def nomes_all(where=sys.argv[1:]):
158162
159163xpath_ruleset = etree .XPath ("/ruleset" )
160164xpath_ruleset_name = etree .XPath ("/ruleset/@name" )
161- xpath_ruleset_platform = etree .XPath ("/ruleset/@platform" )
162165xpath_host = etree .XPath ("/ruleset/target/@host" )
163166xpath_from = etree .XPath ("/ruleset/rule/@from" )
164167xpath_to = etree .XPath ("/ruleset/rule/@to" )
0 commit comments