diff options
author | Matthias Deiml <matthias@deiml.net> | 2020-06-15 18:44:59 +0200 |
---|---|---|
committer | Matthias Deiml <matthias@deiml.net> | 2020-06-17 19:07:14 +0200 |
commit | fa18cf620f1c271bee8808026ab40ffbaa11aee6 (patch) | |
tree | b5f1aa3518bf1c21dca0c43cf1299ee9e3ad7d4e /components/constellation | |
parent | 37394a892c79d6edbef868d6451710648669cc1c (diff) | |
download | servo-fa18cf620f1c271bee8808026ab40ffbaa11aee6.tar.gz servo-fa18cf620f1c271bee8808026ab40ffbaa11aee6.zip |
Make url for "client" referrer mandatory
Diffstat (limited to 'components/constellation')
-rw-r--r-- | components/constellation/constellation.rs | 26 | ||||
-rw-r--r-- | components/constellation/network_listener.rs | 3 |
2 files changed, 24 insertions, 5 deletions
diff --git a/components/constellation/constellation.rs b/components/constellation/constellation.rs index 1106325a1a9..cfca54e8da5 100644 --- a/components/constellation/constellation.rs +++ b/components/constellation/constellation.rs @@ -136,7 +136,7 @@ use msg::constellation_msg::{ TopLevelBrowsingContextId, }; use net_traits::pub_domains::reg_host; -use net_traits::request::RequestBuilder; +use net_traits::request::{Referrer, RequestBuilder}; use net_traits::storage_thread::{StorageThreadMsg, StorageType}; use net_traits::{self, FetchResponseMsg, IpcSend, ResourceThreads}; use profile_traits::mem; @@ -1544,7 +1544,13 @@ where // If there is already a pending page (self.pending_changes), it will not be overridden; // However, if the id is not encompassed by another change, it will be. FromCompositorMsg::LoadUrl(top_level_browsing_context_id, url) => { - let load_data = LoadData::new(LoadOrigin::Constellation, url, None, None, None); + let load_data = LoadData::new( + LoadOrigin::Constellation, + url, + None, + Referrer::NoReferrer, + None, + ); let ctx_id = BrowsingContextId::from(top_level_browsing_context_id); let pipeline_id = match self.browsing_contexts.get(&ctx_id) { Some(ctx) => ctx.pipeline_id, @@ -2888,7 +2894,13 @@ where warn!("creating replacement pipeline for about:failure"); let new_pipeline_id = PipelineId::new(); - let load_data = LoadData::new(LoadOrigin::Constellation, failure_url, None, None, None); + let load_data = LoadData::new( + LoadOrigin::Constellation, + failure_url, + None, + Referrer::NoReferrer, + None, + ); let sandbox = IFrameSandboxState::IFrameSandboxed; let is_private = false; self.new_pipeline( @@ -2998,7 +3010,13 @@ where ); self.embedder_proxy.send(msg); let browsing_context_id = BrowsingContextId::from(top_level_browsing_context_id); - let load_data = LoadData::new(LoadOrigin::Constellation, url, None, None, None); + let load_data = LoadData::new( + LoadOrigin::Constellation, + url, + None, + Referrer::NoReferrer, + None, + ); let sandbox = IFrameSandboxState::IFrameUnsandboxed; let is_private = false; let is_visible = true; diff --git a/components/constellation/network_listener.rs b/components/constellation/network_listener.rs index ccbe00d4940..ec962b42f17 100644 --- a/components/constellation/network_listener.rs +++ b/components/constellation/network_listener.rs @@ -116,7 +116,8 @@ impl NetworkListener { self.request_builder.referrer = metadata .referrer .clone() - .map(|referrer_url| Referrer::ReferrerUrl(referrer_url)); + .map(|referrer_url| Referrer::ReferrerUrl(referrer_url)) + .unwrap_or(Referrer::NoReferrer); self.request_builder.referrer_policy = metadata.referrer_policy; let headers = if let Some(ref headers) = metadata.headers { |