Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make url for "client" referrer mandatory #26926

Merged
merged 5 commits into from Jun 19, 2020
Merged

Conversation

@MDeiml
Copy link
Contributor

MDeiml commented Jun 15, 2020

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

fn Referrer(&self) -> USVString {
let r = self.request.borrow();
USVString(match r.referrer {
NetTraitsRequestReferrer::NoReferrer => String::from(""),
NetTraitsRequestReferrer::Client => String::from("about:client"),
NetTraitsRequestReferrer::ReferrerUrl(ref u) => {
let u_c = u.clone();
u_c.into_string()
},
})
}


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #26570 (GitHub issue number if applicable)
  • There are tests for these changes OR
  • These changes do not require tests because ___
@highfive
Copy link

highfive commented Jun 15, 2020

Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @ferjm (or someone else) soon.

@highfive
Copy link

highfive commented Jun 15, 2020

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/dom/request.rs, components/script/dom/xmlhttprequest.rs, components/constellation/network_listener.rs, components/script/dom/location.rs, components/script/dom/htmlvideoelement.rs and 23 more
  • @cbrewster: components/constellation/network_listener.rs, components/constellation/constellation.rs
  • @jgraham: components/webdriver_server/lib.rs, components/webdriver_server/Cargo.toml
  • @KiChjang: components/script/dom/request.rs, components/script/dom/xmlhttprequest.rs, components/script_traits/lib.rs, components/script/dom/location.rs, components/script/dom/htmlvideoelement.rs and 27 more
@MDeiml
Copy link
Contributor Author

MDeiml commented Jun 15, 2020

I know this is quite a lot of changes but most of it is just replacing Referrer::Client with global_scope.get_referrer(). Maybe it would still be best to split this up into smaller changes?

Also I didn't add tests yet because I don't know what the appropriate place to do so would be.

@jdm
Copy link
Member

jdm commented Jun 15, 2020

@bors-servo try=wpt

bors-servo added a commit that referenced this pull request Jun 15, 2020
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
https://github.com/servo/servo/blob/6b0d9afd6fdc28356ad44af0104ddd25a7b6438d/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. -->
@bors-servo
Copy link
Contributor

bors-servo commented Jun 15, 2020

Trying commit 6850fac with merge d05eadd...

@bors-servo
Copy link
Contributor

bors-servo commented Jun 15, 2020

💔 Test failed - status-taskcluster

@jdm
Copy link
Member

jdm commented Jun 15, 2020

Alright, now we're talking! You're going to want to run ./mach test-wpt tests/wpt/web-platform-tests/referrer-policy /html/semantics/scripting-1/the-script-element/module/ tests/wpt/web-platform-tests/fetch/api /html/semantics/embedded-content/the-img-element/image-loading-lazy-referrerpolicy-change.sub.html tests/wpt/web-platform-tests/xhr --log-raw wpt.log and then ./mach update-wpt wpt.log when that's complete. Then you will want to use git add tests/wpt/metadata so the new expected test results are included in the PR.

@MDeiml
Copy link
Contributor Author

MDeiml commented Jun 15, 2020

Some tests that previously passed no failed, do I need to check those all individually?

@jdm
Copy link
Member

jdm commented Jun 16, 2020

@bors-servo try=wpt

bors-servo added a commit that referenced this pull request Jun 16, 2020
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
https://github.com/servo/servo/blob/6b0d9afd6fdc28356ad44af0104ddd25a7b6438d/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. -->
@bors-servo
Copy link
Contributor

bors-servo commented Jun 16, 2020

Trying commit 70af0bf with merge 5a6d408...

@bors-servo
Copy link
Contributor

bors-servo commented Jun 16, 2020

☀️ Test successful - status-taskcluster
State: approved= try=True

Copy link
Member

jdm left a comment

These changes look like a great improvement!

components/script/dom/xmlhttprequest.rs Outdated Show resolved Hide resolved
components/script/script_module.rs Outdated Show resolved Hide resolved
@jdm
Copy link
Member

jdm commented Jun 17, 2020

This PR will need to be rebased against a recent upstream revision as well.

@jdm
Copy link
Member

jdm commented Jun 18, 2020

The failure appears to be consistent. I recommend updating the appropriate ini file manually.

@jdm
Copy link
Member

jdm commented Jun 19, 2020

@bors-servo
Copy link
Contributor

bors-servo commented Jun 19, 2020

📌 Commit 4039ba3 has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Jun 19, 2020

Testing commit 4039ba3 with merge c88b3af...

bors-servo added a commit that referenced this pull request Jun 19, 2020
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
https://github.com/servo/servo/blob/6b0d9afd6fdc28356ad44af0104ddd25a7b6438d/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. -->
@bors-servo
Copy link
Contributor

bors-servo commented Jun 19, 2020

💔 Test failed - status-taskcluster

@jdm
Copy link
Member

jdm commented Jun 19, 2020

@MDeiml MDeiml force-pushed the MDeiml:referrer-26570 branch from 4039ba3 to a0345ee Jun 19, 2020
@MDeiml
Copy link
Contributor Author

MDeiml commented Jun 19, 2020

Oops, you were faster

@jdm
Copy link
Member

jdm commented Jun 19, 2020

@bors-servo
Copy link
Contributor

bors-servo commented Jun 19, 2020

📌 Commit a0345ee has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Jun 19, 2020

Testing commit a0345ee with merge 854cc79...

@bors-servo
Copy link
Contributor

bors-servo commented Jun 19, 2020

☀️ Test successful - status-taskcluster
Approved by: jdm
Pushing 854cc79 to master...

1 similar comment
@bors-servo
Copy link
Contributor

bors-servo commented Jun 19, 2020

☀️ Test successful - status-taskcluster
Approved by: jdm
Pushing 854cc79 to master...

@bors-servo bors-servo merged commit 854cc79 into servo:master Jun 19, 2020
1 of 2 checks passed
1 of 2 checks passed
Community-TC (pull_request) TaskGroup: Pending (for pull_request.synchronize)
Details
homu Test successful
Details
@MDeiml
Copy link
Contributor Author

MDeiml commented Jun 19, 2020

This probably also solves #26569

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

5 participants
You can’t perform that action at this time.