Auto merge of #26926 - MDeiml:referrer-26570, r=jdm

Make url for "client" referrer mandatory

<!-- Please describe your changes on the following line: -->
I added a url attribute to `Referrer::Client` so that the referrer header can be set accordingly when fetching.

`Referrer::Client` has to be kept separate from `Referrer::ReferrerUrl` as they differ in this method
6b0d9afd6f/components/script/dom/request.rs (L566-L576)

---
<!-- 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 #26570 (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 2020-06-19 11:57:05 -04:00 committed by GitHub
commit 854cc79386
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
535 changed files with 4108 additions and 4685 deletions

View file

@ -52,7 +52,7 @@ impl Tokenizer {
pipeline_id: document.global().pipeline_id(),
base_url: None,
document_url: document.url(),
referrer: Referrer::ReferrerUrl(document.url()),
referrer: document.global().get_referrer(),
referrer_policy: document.get_referrer_policy(),
resource_threads: document.loader().resource_threads().clone(),
// Initially we set prefetching to false, and only set it
@ -126,6 +126,7 @@ impl TokenSink for PrefetchSink {
let request = image_fetch_request(
url,
self.origin.clone(),
self.referrer.clone(),
self.pipeline_id,
self.get_cors_settings(tag, local_name!("crossorigin")),
self.get_referrer_policy(tag, local_name!("referrerpolicy")),