aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/fetch.rs
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2019-09-28 19:42:40 +0000
committerMichael Howell <michael@notriddle.com>2019-10-16 19:46:45 +0000
commitb8f3e8bb2e9bed269a06134c902a139cfa42eb1c (patch)
tree01351cae22488ad49307a5a51f141ba3e29274b2 /components/script/fetch.rs
parent6d488f1be24c1b679931d6d02703f4a10759eb49 (diff)
downloadservo-b8f3e8bb2e9bed269a06134c902a139cfa42eb1c.tar.gz
servo-b8f3e8bb2e9bed269a06134c902a139cfa42eb1c.zip
Add simple implementation of content-security-policy on scripts / styles
This needs a lot more hooks before it'll actually be a good implementation, but for a start it can help get some feedback on if this is the right way to go about it. Part of servo/servo#4577
Diffstat (limited to 'components/script/fetch.rs')
-rw-r--r--components/script/fetch.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/components/script/fetch.rs b/components/script/fetch.rs
index 045e9b93eda..68285653a2f 100644
--- a/components/script/fetch.rs
+++ b/components/script/fetch.rs
@@ -127,6 +127,7 @@ fn request_init_from_request(request: NetTraitsRequest) -> RequestBuilder {
url_list: vec![],
parser_metadata: request.parser_metadata,
initiator: request.initiator,
+ csp_list: None,
}
}
@@ -155,6 +156,7 @@ pub fn Fetch(
let timing_type = request.timing_type();
let mut request_init = request_init_from_request(request);
+ request_init.csp_list = global.get_csp_list().clone();
// Step 3
if global.downcast::<ServiceWorkerGlobalScope>().is_some() {