dont try to redirect if post body cannot be reset

This commit is contained in:
Sean McArthur
2016-11-28 11:36:42 -08:00
parent a54447c1d9
commit 3544e48e8e
3 changed files with 138 additions and 40 deletions

View File

@@ -213,7 +213,13 @@ impl<'a> RequestBuilder<'a> {
true
},
StatusCode::TemporaryRedirect |
StatusCode::PermanentRedirect => true,
StatusCode::PermanentRedirect => {
if let Some(ref body) = body {
body::can_reset(body)
} else {
true
}
},
_ => false,
};