mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
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 -->
This commit is contained in:
commit
949a2d3d11
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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue