mirror of
https://github.com/servo/servo.git
synced 2025-08-08 06:55:31 +01:00
Implement PolicyContainer and update the default ReferrerPolicy (#33977)
* Implement PolicyContainer Signed-off-by: Shane Handley <shanehandley@fastmail.com> * implement small parts of fetch that interact with policy container Signed-off-by: Shane Handley <shanehandley@fastmail.com> * fix: allow policy container's csp list to be unset Signed-off-by: Shane Handley <shanehandley@fastmail.com> * fix: use the correct default policy when parsing from a token Signed-off-by: Shane Handley <shanehandley@fastmail.com> --------- Signed-off-by: Shane Handley <shanehandley@fastmail.com>
This commit is contained in:
parent
4f6283d7fe
commit
6451767428
201 changed files with 210 additions and 5178 deletions
|
@ -7,6 +7,7 @@ use std::cell::Cell;
|
|||
use base::id::ServiceWorkerRegistrationId;
|
||||
use devtools_traits::WorkerId;
|
||||
use dom_struct::dom_struct;
|
||||
use net_traits::request::Referrer;
|
||||
use script_traits::{ScopeThings, WorkerScriptLoadOrigin};
|
||||
use servo_url::ServoUrl;
|
||||
use uuid::Uuid;
|
||||
|
@ -112,8 +113,12 @@ impl ServiceWorkerRegistration {
|
|||
|
||||
pub fn create_scope_things(global: &GlobalScope, script_url: ServoUrl) -> ScopeThings {
|
||||
let worker_load_origin = WorkerScriptLoadOrigin {
|
||||
referrer_url: None,
|
||||
referrer_policy: None,
|
||||
referrer_url: match global.get_referrer() {
|
||||
Referrer::Client(url) => Some(url),
|
||||
Referrer::ReferrerUrl(url) => Some(url),
|
||||
_ => None,
|
||||
},
|
||||
referrer_policy: Some(global.policy_container().referrer_policy),
|
||||
pipeline_id: global.pipeline_id(),
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue