From 1c0af5f75df459503084c041c750cc2e8e273623 Mon Sep 17 00:00:00 2001 From: David Mehren Date: Thu, 5 Aug 2021 23:06:28 +0200 Subject: [PATCH] Cleanup csp.js Signed-off-by: David Mehren --- lib/csp.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/csp.js b/lib/csp.js index 98996073f..cebc050c8 100644 --- a/lib/csp.js +++ b/lib/csp.js @@ -79,10 +79,6 @@ function mergeDirectivesIf (condition, existingDirectives, newDirectives) { } } -function areAllInlineScriptsAllowed (directives) { - return directives.scriptSrc.indexOf('\'unsafe-inline\'') !== -1 -} - function addInlineScriptExceptions (directives) { directives.scriptSrc.push(getCspNonce) // TODO: This is the SHA-256 hash of the inline script in build/reveal.js/plugins/notes/notes.html @@ -91,7 +87,7 @@ function addInlineScriptExceptions (directives) { } function getCspNonce (req, res) { - return "'nonce-" + res.locals.nonce + "'" + return '\'nonce-' + res.locals.nonce + '\'' } function addUpgradeUnsafeRequestsOptionTo (directives) {