diff --git a/src/unit.rs b/src/unit.rs index 166fc12..f39bd3b 100644 --- a/src/unit.rs +++ b/src/unit.rs @@ -263,9 +263,13 @@ pub(crate) fn connect( debug!("redirect {} {} -> {}", resp.status(), url, new_url); 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), }; } }