Follow 307/308 redirects

This commit is contained in:
Joshua Nelson
2020-11-23 18:27:25 -05:00
committed by Martin Algesten
parent 7afc4b04f3
commit 8d21052c7e

View File

@@ -263,9 +263,13 @@ pub(crate) fn connect(
debug!("redirect {} {} -> {}", resp.status(), url, new_url); debug!("redirect {} {} -> {}", resp.status(), url, new_url);
return connect(new_unit, use_pooled, redirect_count + 1, empty, true); return connect(new_unit, use_pooled, redirect_count + 1, empty, true);
} }
// never change the method for 307/308
307 | 308 => {
let empty = Payload::Empty.into_read();
debug!("redirect {} {} -> {}", resp.status(), url, new_url);
return connect(unit, use_pooled, redirect_count - 1, empty, true);
}
_ => (), _ => (),
// reinstate this with expect-100
// 307 | 308 | _ => connect(unit, method, use_pooled, redirects - 1, body),
}; };
} }
} }