mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Auto merge of #23090 - miller-time:nav-fetch-referrer, r=gterzian
Add referrer to navigation fetch request <!-- Please describe your changes on the following line: --> Implement step 13 of [following hyperlinks](https://html.spec.whatwg.org/#following-hyperlinks-2) and step 14.3 of [window open](https://html.spec.whatwg.org/#window-open-steps), as well as other referrer- and fetch-related updates. --- <!-- 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 #22890 (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. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23090) <!-- Reviewable:end -->
This commit is contained in:
commit
b73956cc37
22 changed files with 136 additions and 88 deletions
|
@ -12,7 +12,7 @@ use ipc_channel::ipc;
|
|||
use ipc_channel::router::ROUTER;
|
||||
use msg::constellation_msg::PipelineId;
|
||||
use net::http_loader::{set_default_accept, set_default_accept_language};
|
||||
use net_traits::request::{Destination, RequestBuilder};
|
||||
use net_traits::request::{Destination, Referrer, RequestBuilder};
|
||||
use net_traits::response::ResponseInit;
|
||||
use net_traits::{CoreResourceMsg, FetchChannels, FetchMetadata, FetchResponseMsg};
|
||||
use net_traits::{IpcSend, NetworkError, ResourceThreads};
|
||||
|
@ -109,7 +109,10 @@ impl NetworkListener {
|
|||
.url_list
|
||||
.push(metadata.final_url.clone());
|
||||
|
||||
self.request_builder.referrer_url = metadata.referrer.clone();
|
||||
self.request_builder.referrer = metadata
|
||||
.referrer
|
||||
.clone()
|
||||
.map(|referrer_url| Referrer::ReferrerUrl(referrer_url));
|
||||
self.request_builder.referrer_policy = metadata.referrer_policy;
|
||||
|
||||
self.res_init = Some(ResponseInit {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue