diff options
author | Gregory Terzian <gterzian@users.noreply.github.com> | 2017-11-15 10:16:16 +0800 |
---|---|---|
committer | Gregory Terzian <gterzian@users.noreply.github.com> | 2017-11-16 13:36:22 +0800 |
commit | b98635f2122b5c1c47252b351994a0b2c6bc2140 (patch) | |
tree | c138c00ba92bf01c19a1adb485561723755ed6a2 | |
parent | 2799b4eac9d903929246bda9d83cdaf9543f31d9 (diff) | |
download | servo-b98635f2122b5c1c47252b351994a0b2c6bc2140.tar.gz servo-b98635f2122b5c1c47252b351994a0b2c6bc2140.zip |
allow unknown HTTP methods
5 files changed, 1 insertions, 43 deletions
diff --git a/components/script/dom/request.rs b/components/script/dom/request.rs index fcd396c1176..85998533ae9 100644 --- a/components/script/dom/request.rs +++ b/components/script/dom/request.rs @@ -462,17 +462,7 @@ fn normalize_method(m: &str) -> HttpMethod { // https://fetch.spec.whatwg.org/#concept-method fn is_method(m: &ByteString) -> bool { - match m.to_lower().as_str() { - Some("get") => true, - Some("head") => true, - Some("post") => true, - Some("put") => true, - Some("delete") => true, - Some("connect") => true, - Some("options") => true, - Some("trace") => true, - _ => false, - } + m.as_str().is_some() } // https://fetch.spec.whatwg.org/#forbidden-method diff --git a/tests/wpt/metadata/fetch/api/basic/request-headers.any.js.ini b/tests/wpt/metadata/fetch/api/basic/request-headers.any.js.ini index fc724ad68bd..ea7c5b5edf7 100644 --- a/tests/wpt/metadata/fetch/api/basic/request-headers.any.js.ini +++ b/tests/wpt/metadata/fetch/api/basic/request-headers.any.js.ini @@ -39,12 +39,6 @@ [Fetch with Chicken with body] expected: FAIL - [Fetch with TacO and mode "same-origin" needs an Origin header] - expected: FAIL - - [Fetch with TacO and mode "cors" needs an Origin header] - expected: FAIL - [request-headers.any.worker.html] type: testharness diff --git a/tests/wpt/metadata/fetch/api/cors/cors-preflight-star.any.js.ini b/tests/wpt/metadata/fetch/api/cors/cors-preflight-star.any.js.ini index b99585d72cb..775345b3f73 100644 --- a/tests/wpt/metadata/fetch/api/cors/cors-preflight-star.any.js.ini +++ b/tests/wpt/metadata/fetch/api/cors/cors-preflight-star.any.js.ini @@ -1,8 +1,5 @@ [cors-preflight-star.any.html] type: testharness - [CORS that succeeds with credentials: false; method: SUPER (allowed: *); header: X-Test,1 (allowed: x-test)] - expected: FAIL - [CORS that succeeds with credentials: false; method: OK (allowed: *); header: X-Test,1 (allowed: *)] expected: FAIL diff --git a/tests/wpt/metadata/fetch/api/cors/cors-preflight.any.js.ini b/tests/wpt/metadata/fetch/api/cors/cors-preflight.any.js.ini index 5f6b56e0621..338a4ba3c2b 100644 --- a/tests/wpt/metadata/fetch/api/cors/cors-preflight.any.js.ini +++ b/tests/wpt/metadata/fetch/api/cors/cors-preflight.any.js.ini @@ -1,11 +1,5 @@ [cors-preflight.any.html] type: testharness - [CORS [PATCH\], server allows] - expected: FAIL - - [CORS [NEW\], server allows] - expected: FAIL - [CORS [GET\] [several headers\], server allows] expected: FAIL @@ -15,12 +9,6 @@ [cors-preflight.any.worker.html] type: testharness - [CORS [PATCH\], server allows] - expected: FAIL - - [CORS [NEW\], server allows] - expected: FAIL - [CORS [GET\] [several headers\], server allows] expected: FAIL diff --git a/tests/wpt/metadata/fetch/http-cache/invalidate.html.ini b/tests/wpt/metadata/fetch/http-cache/invalidate.html.ini deleted file mode 100644 index 2ef2eb49c2b..00000000000 --- a/tests/wpt/metadata/fetch/http-cache/invalidate.html.ini +++ /dev/null @@ -1,11 +0,0 @@ -[invalidate.html] - type: testharness - [HTTP cache invalidates after a successful response from an unknown method] - expected: FAIL - - [HTTP cache invalidates Location URL after a successful response from an unknown method] - expected: FAIL - - [HTTP cache invalidates Content-Location URL after a successful response from an unknown method] - expected: FAIL - |