mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-17 08:34:54 -04:00
Cleanup csp.js
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
bd44cbc16c
commit
1c0af5f75d
1 changed files with 1 additions and 5 deletions
|
@ -79,10 +79,6 @@ function mergeDirectivesIf (condition, existingDirectives, newDirectives) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function areAllInlineScriptsAllowed (directives) {
|
|
||||||
return directives.scriptSrc.indexOf('\'unsafe-inline\'') !== -1
|
|
||||||
}
|
|
||||||
|
|
||||||
function addInlineScriptExceptions (directives) {
|
function addInlineScriptExceptions (directives) {
|
||||||
directives.scriptSrc.push(getCspNonce)
|
directives.scriptSrc.push(getCspNonce)
|
||||||
// TODO: This is the SHA-256 hash of the inline script in build/reveal.js/plugins/notes/notes.html
|
// 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) {
|
function getCspNonce (req, res) {
|
||||||
return "'nonce-" + res.locals.nonce + "'"
|
return '\'nonce-' + res.locals.nonce + '\''
|
||||||
}
|
}
|
||||||
|
|
||||||
function addUpgradeUnsafeRequestsOptionTo (directives) {
|
function addUpgradeUnsafeRequestsOptionTo (directives) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue