mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Implement Subresource Integrity
Implemented response validation part of https://w3c.github.io/webappsec-subresource-integrity/. Implemented step eighteen of the main fetch. If a request has integrity metadata, then following steps are performed *Wait for response body *If the response does not have a termination reason and response does not match request’s integrity metadata, set response to a network error.# Please enter the commit message for your changes. Lines starting
This commit is contained in:
parent
496447a363
commit
a3026499f4
19 changed files with 439 additions and 260 deletions
|
@ -158,6 +158,7 @@ pub struct RequestInit {
|
|||
pub referrer_policy: Option<ReferrerPolicy>,
|
||||
pub pipeline_id: Option<PipelineId>,
|
||||
pub redirect_mode: RedirectMode,
|
||||
pub integrity_metadata: String,
|
||||
}
|
||||
|
||||
impl Default for RequestInit {
|
||||
|
@ -181,6 +182,7 @@ impl Default for RequestInit {
|
|||
referrer_policy: None,
|
||||
pipeline_id: None,
|
||||
redirect_mode: RedirectMode::Follow,
|
||||
integrity_metadata: "".to_owned(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -291,6 +293,7 @@ impl Request {
|
|||
req.referrer_policy.set(init.referrer_policy);
|
||||
req.pipeline_id.set(init.pipeline_id);
|
||||
req.redirect_mode.set(init.redirect_mode);
|
||||
*req.integrity_metadata.borrow_mut() = init.integrity_metadata;
|
||||
req
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue