allow unknown HTTP methods

This commit is contained in:
Gregory Terzian 2017-11-15 10:16:16 +08:00
parent 2799b4eac9
commit b98635f212
5 changed files with 1 additions and 43 deletions

View file

@ -462,17 +462,7 @@ fn normalize_method(m: &str) -> HttpMethod {
// https://fetch.spec.whatwg.org/#concept-method // https://fetch.spec.whatwg.org/#concept-method
fn is_method(m: &ByteString) -> bool { fn is_method(m: &ByteString) -> bool {
match m.to_lower().as_str() { m.as_str().is_some()
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,
}
} }
// https://fetch.spec.whatwg.org/#forbidden-method // https://fetch.spec.whatwg.org/#forbidden-method

View file

@ -39,12 +39,6 @@
[Fetch with Chicken with body] [Fetch with Chicken with body]
expected: FAIL 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] [request-headers.any.worker.html]
type: testharness type: testharness

View file

@ -1,8 +1,5 @@
[cors-preflight-star.any.html] [cors-preflight-star.any.html]
type: testharness 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: *)] [CORS that succeeds with credentials: false; method: OK (allowed: *); header: X-Test,1 (allowed: *)]
expected: FAIL expected: FAIL

View file

@ -1,11 +1,5 @@
[cors-preflight.any.html] [cors-preflight.any.html]
type: testharness type: testharness
[CORS [PATCH\], server allows]
expected: FAIL
[CORS [NEW\], server allows]
expected: FAIL
[CORS [GET\] [several headers\], server allows] [CORS [GET\] [several headers\], server allows]
expected: FAIL expected: FAIL
@ -15,12 +9,6 @@
[cors-preflight.any.worker.html] [cors-preflight.any.worker.html]
type: testharness type: testharness
[CORS [PATCH\], server allows]
expected: FAIL
[CORS [NEW\], server allows]
expected: FAIL
[CORS [GET\] [several headers\], server allows] [CORS [GET\] [several headers\], server allows]
expected: FAIL expected: FAIL

View file

@ -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