mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
script: Append to existing CSP list in set_csp_list
Signed-off-by: Emmanuel Paul Elom <elomemmanuel007@gmail.com>
This commit is contained in:
parent
ed469fe72f
commit
7e61cee526
8 changed files with 133 additions and 60 deletions
|
@ -4293,7 +4293,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