Enabled unsafe eval

This commit is contained in:
maudnals
2021-12-23 09:29:04 +01:00
parent 8a860f285c
commit 8aeea1dc04

View File

@@ -35,7 +35,9 @@ function addCspAsMetaTag(htmlString: string) {
// Hash inline scripts from this html file, if there are any
const scriptHashes = s.hashAllInlineScripts();
// Generate a strict CSP as a string
const strictCsp = StrictCsp.getStrictCsp(scriptHashes, false, true);
// enableTrustedTypes: false, enableBrowserFallbacks: true
// enableUnsafeEval: true, to accomodate for uses of eval by emscripten. Enabling eval makes the CSP a bit less secure
const strictCsp = StrictCsp.getStrictCsp(scriptHashes, false, true, true);
// Set this CSP via a meta tag
s.addMetaTag(strictCsp);
const htmlStringWithCsp = s.serializeDom();