mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +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
|
@ -6,6 +6,7 @@ use std::rc::Rc;
|
|||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use ipc_channel::ipc;
|
||||
use net_traits::policy_container::RequestPolicyContainer;
|
||||
use net_traits::request::{
|
||||
CorsSettings, CredentialsMode, Destination, Referrer, Request as NetTraitsRequest,
|
||||
RequestBuilder, RequestId, RequestMode, ServiceWorkersMode,
|
||||
|
@ -127,7 +128,7 @@ fn request_init_from_request(request: NetTraitsRequest) -> RequestBuilder {
|
|||
url_list: vec![],
|
||||
parser_metadata: request.parser_metadata,
|
||||
initiator: request.initiator,
|
||||
csp_list: None,
|
||||
policy_container: request.policy_container,
|
||||
https_state: request.https_state,
|
||||
response_tainting: request.response_tainting,
|
||||
crash: None,
|
||||
|
@ -167,7 +168,8 @@ pub fn Fetch(
|
|||
let timing_type = request.timing_type();
|
||||
|
||||
let mut request_init = request_init_from_request(request);
|
||||
request_init.csp_list.clone_from(&global.get_csp_list());
|
||||
request_init.policy_container =
|
||||
RequestPolicyContainer::PolicyContainer(global.policy_container());
|
||||
|
||||
// TODO: Step 4. If requestObject’s signal is aborted, then: [..]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue