This repository was archived by the owner on Jan 5, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -388,7 +388,7 @@ impl RuleSets {
388388 for index in 0 ..( segmented. len ( ) - 1 ) {
389389 let mut segmented_tmp = segmented. clone ( ) ;
390390 segmented_tmp[ index] = "*" ;
391- let tmp_host = segmented_tmp. join ( "." ) ;
391+ let tmp_host = & segmented_tmp[ index..segmented . len ( ) ] . join ( "." ) ;
392392 self . try_add ( & mut results, & tmp_host) ;
393393 }
394394
@@ -451,7 +451,10 @@ pub mod tests {
451451 let mut rs = RuleSets :: new ( ) ;
452452 add_mock_rulesets ( & mut rs) ;
453453
454+ assert_eq ! ( rs. potentially_applicable( & String :: from( "foo.1fichier.com" ) ) . len( ) , 1 ) ;
455+ assert_eq ! ( rs. potentially_applicable( & String :: from( "bar.foo.1fichier.com" ) ) . len( ) , 1 ) ;
454456 assert_eq ! ( rs. potentially_applicable( & String :: from( "foo.storage.googleapis.com" ) ) . len( ) , 1 ) ;
457+ assert_eq ! ( rs. potentially_applicable( & String :: from( "bar.foo.storage.googleapis.com" ) ) . len( ) , 1 ) ;
455458 }
456459
457460 #[ test]
You can’t perform that action at this time.
0 commit comments