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

@ -3669,13 +3669,12 @@ impl ScriptThread {
/// argument until a notification is received that the fetch is complete.
fn pre_page_load(&self, mut incomplete: InProgressLoad, load_data: LoadData) {
let id = incomplete.pipeline_id.clone();
let req_init = RequestBuilder::new(load_data.url.clone())
let req_init = RequestBuilder::new(load_data.url.clone(), load_data.referrer)
.method(load_data.method)
.destination(Destination::Document)
.credentials_mode(CredentialsMode::Include)
.use_url_credentials(true)
.pipeline_id(Some(id))
.referrer(load_data.referrer)
.referrer_policy(load_data.referrer_policy)
.headers(load_data.headers)
.body(load_data.data)