This commit is contained in:
Mohsen Alizadeh 2021-05-23 22:56:49 +02:00
parent b4b354eed0
commit 769fd8308b
1 changed files with 4 additions and 2 deletions

View File

@ -156,7 +156,8 @@ where
StatusCode::MOVED_PERMANENTLY StatusCode::MOVED_PERMANENTLY
| StatusCode::FOUND | StatusCode::FOUND
| StatusCode::SEE_OTHER | StatusCode::SEE_OTHER
if *max_redirect_times > 0 && res.headers().contains_key(header::LOCATION) => if *max_redirect_times > 0
&& res.headers().contains_key(header::LOCATION) =>
{ {
let org_uri = uri.take().unwrap(); let org_uri = uri.take().unwrap();
// rebuild uri from the location header value. // rebuild uri from the location header value.
@ -203,7 +204,8 @@ where
self.poll(cx) self.poll(cx)
} }
StatusCode::TEMPORARY_REDIRECT | StatusCode::PERMANENT_REDIRECT StatusCode::TEMPORARY_REDIRECT | StatusCode::PERMANENT_REDIRECT
if *max_redirect_times > 0 && res.headers().contains_key(header::LOCATION) => if *max_redirect_times > 0
&& res.headers().contains_key(header::LOCATION) =>
{ {
let org_uri = uri.take().unwrap(); let org_uri = uri.take().unwrap();
// rebuild uri from the location header value. // rebuild uri from the location header value.