mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
CORS Preflight Logic Fix
Fix check to set flag if any header is a simple header. Fix failing tests to allow merge in advance of @nikkibee's changes as per @jdm's direction via IRC
This commit is contained in:
parent
7aedb9c7cd
commit
1ccb642ee4
2 changed files with 24 additions and 1 deletions
|
@ -77,7 +77,7 @@ impl CORSRequest {
|
|||
let mut req = CORSRequest::new(referer, destination, mode, method, headers);
|
||||
req.preflight_flag = !is_simple_method(&req.method) ||
|
||||
mode == RequestMode::ForcedPreflight;
|
||||
if req.headers.iter().all(|h| is_simple_header(&h)) {
|
||||
if req.headers.iter().any(|h| !is_simple_header(&h)) {
|
||||
req.preflight_flag = true;
|
||||
}
|
||||
Ok(Some(req))
|
||||
|
|
|
@ -108,3 +108,26 @@
|
|||
[remote (http://web-platform.test:8000) to remote2 (null), expect origin=null]
|
||||
expected: FAIL
|
||||
|
||||
[remote (http://www1.web-platform.test:8000) to remote (*), expect to fail]
|
||||
expected: FAIL
|
||||
|
||||
[remote (null) to remote2 (*), expect to fail]
|
||||
expected: FAIL
|
||||
|
||||
[remote (none) to remote2 (*), expect to fail]
|
||||
expected: FAIL
|
||||
|
||||
[remote (none) to remote2 (*), expect to fail]
|
||||
expected: FAIL
|
||||
|
||||
[remote (null) to remote (*), expect to fail]
|
||||
expected: FAIL
|
||||
|
||||
[remote (none) to remote (*), expect to fail]
|
||||
expected: FAIL
|
||||
|
||||
[remote (none) to local (*), expect to fail]
|
||||
expected: FAIL
|
||||
|
||||
[remote (null) to local (*), expect to fail]
|
||||
expected: FAIL
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue