Skip to content

Commit

Permalink
Follow 307/308 redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
jyn514 authored and algesten committed Dec 5, 2020
1 parent 165eae3 commit 2b395e1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/unit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,13 @@ pub(crate) fn connect(
debug!("redirect {} {} -> {}", resp.status(), url, new_url);
return connect(req, 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(req, unit, use_pooled, redirect_count - 1, empty, true);
}
_ => (),
// reinstate this with expect-100
// 307 | 308 | _ => connect(unit, method, use_pooled, redirects - 1, body),
};
}
}
Expand Down

0 comments on commit 2b395e1

Please sign in to comment.