Make url for "client" referrer mandatory

This commit is contained in:
Matthias Deiml 2020-06-15 18:44:59 +02:00
parent 37394a892c
commit fa18cf620f
38 changed files with 410 additions and 213 deletions

View file

@ -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;

View file

@ -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 {