mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Merge 7e61cee526
into 5ef66ce386
This commit is contained in:
commit
8dbcb49906
8 changed files with 133 additions and 60 deletions
|
@ -4299,7 +4299,14 @@ impl Document {
|
|||
}
|
||||
|
||||
pub(crate) fn set_csp_list(&self, csp_list: Option<CspList>) {
|
||||
self.policy_container.borrow_mut().set_csp_list(csp_list);
|
||||
if let Some(new_list) = csp_list {
|
||||
let mut current = self.get_csp_list();
|
||||
match current {
|
||||
Some(ref mut existing) => existing.append(new_list),
|
||||
None => current = Some(new_list),
|
||||
}
|
||||
self.policy_container.borrow_mut().set_csp_list(current);
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn get_csp_list(&self) -> Option<CspList> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue