Auto merge of #21454 - tigercosmos:fetch, r=KiChjang

Network: Preserve HEAD on 303 redirect

fixed #21449. This is an update for spec.

This PR just update one step for redirect fetch according to spec. No tests result change, since the whole process is still in development(So many todo).

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21454)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2018-08-18 21:59:56 -04:00 committed by GitHub
commit 022cc93c22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -677,7 +677,7 @@ pub fn http_redirect_fetch(request: &mut Request,
// Step 11
if response.actual_response().status.map_or(false, |code|
((code == StatusCode::MovedPermanently || code == StatusCode::Found) && request.method == Method::Post) ||
code == StatusCode::SeeOther) {
(code == StatusCode::SeeOther && request.method != Method::Head)) {
request.method = Method::Get;
request.body = None;
}