Revert deletions of client_error and friends.

This commit is contained in:
Jacob Hoffman-Andrews
2020-12-02 00:10:36 -08:00
committed by Martin Algesten
parent 64ebd47979
commit 18a9b08973
4 changed files with 28 additions and 3 deletions

View File

@@ -231,7 +231,7 @@ pub(crate) fn connect(
save_cookies(&unit, &resp);
// handle redirects
if resp.status() >= 300 && resp.status() < 400 && unit.agent.config.redirects > 0 {
if resp.redirect() && unit.agent.config.redirects > 0 {
if redirect_count == unit.agent.config.redirects {
return Err(ErrorKind::TooManyRedirects.new());
}