diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-02-17 12:56:05 +0530 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2016-02-17 12:56:05 +0530 |
commit | 949a2d3d11d41912fb30e2d152045beb8c2aeebc (patch) | |
tree | b71134c0105424c95a4b63f076404ce9e6a9a81b /components/script | |
parent | 5487ba35ebf0647667e574b4a192d8c87be999ea (diff) | |
parent | 1ccb642ee4ad1eec7802df1e27244b9f91651e3e (diff) | |
download | servo-949a2d3d11d41912fb30e2d152045beb8c2aeebc.tar.gz servo-949a2d3d11d41912fb30e2d152045beb8c2aeebc.zip |
Auto merge of #9667 - Tycheon:9472, r=KiChjang
CORS Preflight Logic Fix
Fix check to set flag if any header is not a simple header, rather than only if all
headers are simple headers.
Fix failing tests to allow merge in advance of @nikkibee's changes
as per @jdm's direction via IRC.
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9667)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script')
-rw-r--r-- | components/script/cors.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/components/script/cors.rs b/components/script/cors.rs index e64583e0a58..0c225db1b1d 100644 --- a/components/script/cors.rs +++ b/components/script/cors.rs @@ -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)) |