mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-22 01:36:29 -05:00
Fix upgradeInsecureRequests CSP directive
The `upgradeInsecureRequests` option of Helmets CSP middleware was a boolean in Helmet 3, but with Helmet 4, everything changed to lists. This commit adjusts the addUpgradeUnsafeRequestsOptionTo function accordingly. Closes #1221 See also https://github.com/helmetjs/helmet/tree/v4.6.0/middlewares/content-security-policy Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
e6d4ac5f9a
commit
0b61f48129
1 changed files with 2 additions and 2 deletions
|
@ -85,9 +85,9 @@ function getCspNonce (req, res) {
|
|||
|
||||
function addUpgradeUnsafeRequestsOptionTo (directives) {
|
||||
if (config.csp.upgradeInsecureRequests === 'auto' && config.useSSL) {
|
||||
directives.upgradeInsecureRequests = true
|
||||
directives.upgradeInsecureRequests = []
|
||||
} else if (config.csp.upgradeInsecureRequests === true) {
|
||||
directives.upgradeInsecureRequests = true
|
||||
directives.upgradeInsecureRequests = []
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue