Fix a mistake in the redirect fetch code

The spec says to ignore both HEAD and GET in step 11
This commit is contained in:
Bastien Orivel 2019-12-21 15:12:07 +01:00
parent aa43ce8cf3
commit 2b28042446
2 changed files with 3 additions and 7 deletions

View file

@ -804,7 +804,9 @@ pub fn http_redirect_fetch(
.map_or(false, |(code, _)| { .map_or(false, |(code, _)| {
((*code == StatusCode::MOVED_PERMANENTLY || *code == StatusCode::FOUND) && ((*code == StatusCode::MOVED_PERMANENTLY || *code == StatusCode::FOUND) &&
request.method == Method::POST) || request.method == Method::POST) ||
(*code == StatusCode::SEE_OTHER && request.method != Method::HEAD) (*code == StatusCode::SEE_OTHER &&
request.method != Method::HEAD &&
request.method != Method::GET)
}) })
{ {
// Step 11.1 // Step 11.1

View file

@ -1,7 +1,4 @@
[redirect-method.any.worker.html] [redirect-method.any.worker.html]
[Redirect 303 with GET]
expected: FAIL
[Redirect 307 with POST (string body)] [Redirect 307 with POST (string body)]
expected: FAIL expected: FAIL
@ -10,9 +7,6 @@
[redirect-method.any.html] [redirect-method.any.html]
[Redirect 303 with GET]
expected: FAIL
[Redirect 307 with POST (string body)] [Redirect 307 with POST (string body)]
expected: FAIL expected: FAIL