File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed
Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -96,16 +96,6 @@ impl RedirectionLoop {
9696 }
9797
9898 if i > 1 {
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- }
108-
10999 error = Some ( RedirectionError :: AtLeastOneHop ) ;
110100 }
111101
@@ -131,6 +121,16 @@ impl RedirectionLoop {
131121 method : current_method. clone ( ) ,
132122 } ) ;
133123
124+ // If the url cannot be parsed, let's treat it as a relative Url.
125+ // Otherwise, we check if the corresponding domain is registered in the project.
126+ if let Ok ( url) = Url :: parse ( & current_url) {
127+ if !project_domains. is_empty ( ) && !project_domains. contains ( & url. host_str ( ) . unwrap ( ) . to_string ( ) ) {
128+ // The current url target a domain that is not registered in the project.
129+ // So we consider there is no redirection loop here.
130+ break ;
131+ }
132+ }
133+
134134 if i >= max_hops {
135135 error = Some ( RedirectionError :: TooManyHops ) ;
136136 break ;
You can’t perform that action at this time.
0 commit comments