mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 15:14:56 -04:00
CSP: Upgrade insecure requests if possible
Config option; default is to only upgrade if usessl
This commit is contained in:
parent
ba183ce654
commit
5d2d3ec875
2 changed files with 8 additions and 2 deletions
5
app.js
5
app.js
|
@ -126,6 +126,11 @@ if (config.csp.enable) {
|
|||
directives[propertyName] = directive;
|
||||
}
|
||||
}
|
||||
if(config.csp.upgradeInsecureRequests === 'auto') {
|
||||
directives.upgradeInsecureRequests = config.usessl === 'true'
|
||||
} else {
|
||||
directives.upgradeInsecureRequests = config.csp.upgradeInsecureRequests === 'true'
|
||||
}
|
||||
app.use(helmet.contentSecurityPolicy({
|
||||
directives: directives
|
||||
}))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue