File tree Expand file tree Collapse file tree 2 files changed +14
-11
lines changed
Expand file tree Collapse file tree 2 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -96,16 +96,15 @@ impl RedirectionLoop {
9696 }
9797
9898 if i > 1 {
99- match Url :: parse ( & current_url) {
100- Ok ( url) => {
101- if !project_domains. is_empty ( ) && !project_domains. contains ( & url. host_str ( ) . unwrap ( ) . to_string ( ) ) {
102- // The current url target a domain that is not registered in the project.
103- // So we consider there is no redirection loop here.
104- break ;
105- }
106- } ,
107- Err ( _) => { }
108- } ;
99+ // If the url cannot be parsed, let's treat it as a relative Url.
100+ // Otherwise, we check if the corresponding domain is registered in the project.
101+ if let Ok ( url) = Url :: parse ( & current_url) {
102+ if !project_domains. is_empty ( ) && !project_domains. contains ( & url. host_str ( ) . unwrap ( ) . to_string ( ) ) {
103+ // The current url target a domain that is not registered in the project.
104+ // So we consider there is no redirection loop here.
105+ break ;
106+ }
107+ }
109108
110109 error = Some ( RedirectionError :: AtLeastOneHop ) ;
111110 }
Original file line number Diff line number Diff line change @@ -72,7 +72,11 @@ impl TestExamplesOutput {
7272 pub fn from_project ( test_examples_input : TestExamplesProjectInput , existing_router : Arc < Router < Rule > > ) -> TestExamplesOutput {
7373 let test_example_router = test_examples_input. change_set . update_existing_router ( existing_router) ;
7474
75- Self :: create_result ( & test_example_router, test_examples_input. max_hops , test_examples_input. project_domains )
75+ Self :: create_result (
76+ & test_example_router,
77+ test_examples_input. max_hops ,
78+ test_examples_input. project_domains ,
79+ )
7680 }
7781
7882 pub fn create_result_without_project ( test_examples_input : TestExamplesInput ) -> TestExamplesOutput {
You can’t perform that action at this time.
0 commit comments