Auto merge of #24590 - shnmorimoto:fix-24367, r=jdm

Fix timing allow check

<!-- Please describe your changes on the following line: -->
Fix #24367

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #24367 (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
bors-servo 2019-11-06 00:39:07 -05:00 committed by GitHub
commit 8abc272d27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1462,7 +1462,12 @@ fn http_network_fetch(
_ => false,
});
if !req_origin_in_timing_allow && !wildcard_present {
let is_same_origin = request.url_list.iter().all(|url| match request.origin {
SpecificOrigin(ref immutable_request_origin) => url.origin() == *immutable_request_origin,
_ => false,
});
if !(is_same_origin || req_origin_in_timing_allow || wildcard_present) {
context.timing.lock().unwrap().mark_timing_check_failed();
}