diff options
Diffstat (limited to 'components/shared/net/request.rs')
-rw-r--r-- | components/shared/net/request.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/components/shared/net/request.rs b/components/shared/net/request.rs index 58cba5cba5c..8dec7668077 100644 --- a/components/shared/net/request.rs +++ b/components/shared/net/request.rs @@ -292,6 +292,7 @@ pub struct RequestBuilder { /// <https://fetch.spec.whatwg.org/#concept-request-policy-container> pub policy_container: RequestPolicyContainer, pub insecure_requests_policy: InsecureRequestsPolicy, + pub has_trustworthy_ancestor_origin: bool, /// <https://fetch.spec.whatwg.org/#concept-request-referrer> pub referrer: Referrer, @@ -344,6 +345,7 @@ impl RequestBuilder { origin: ImmutableOrigin::new_opaque(), policy_container: RequestPolicyContainer::default(), insecure_requests_policy: InsecureRequestsPolicy::DoNotUpgrade, + has_trustworthy_ancestor_origin: false, referrer, referrer_policy: ReferrerPolicy::EmptyString, pipeline_id: None, @@ -493,6 +495,14 @@ impl RequestBuilder { self } + pub fn has_trustworthy_ancestor_origin( + mut self, + has_trustworthy_ancestor_origin: bool, + ) -> RequestBuilder { + self.has_trustworthy_ancestor_origin = has_trustworthy_ancestor_origin; + self + } + /// <https://fetch.spec.whatwg.org/#request-service-workers-mode> pub fn service_workers_mode( mut self, @@ -546,6 +556,7 @@ impl RequestBuilder { request.crash = self.crash; request.policy_container = self.policy_container; request.insecure_requests_policy = self.insecure_requests_policy; + request.has_trustworthy_ancestor_origin = self.has_trustworthy_ancestor_origin; request } } @@ -621,6 +632,7 @@ pub struct Request { pub policy_container: RequestPolicyContainer, /// <https://w3c.github.io/webappsec-upgrade-insecure-requests/#insecure-requests-policy> pub insecure_requests_policy: InsecureRequestsPolicy, + pub has_trustworthy_ancestor_origin: bool, pub https_state: HttpsState, /// Servo internal: if crash details are present, trigger a crash error page with these details. pub crash: Option<String>, @@ -668,6 +680,7 @@ impl Request { response_tainting: ResponseTainting::Basic, policy_container: RequestPolicyContainer::Client, insecure_requests_policy: InsecureRequestsPolicy::DoNotUpgrade, + has_trustworthy_ancestor_origin: false, https_state, crash: None, } |