mirror of
https://github.com/status-im/codimd.git
synced 2025-02-11 19:26:35 +00:00
ts: lib/csp.js
Signed-off-by: Raccoon <raccoon@hackmd.io>
This commit is contained in:
parent
8ea1eb2650
commit
385ef6940b
@ -1,7 +1,7 @@
|
||||
import * as config from "./config";
|
||||
import * as uuid from "uuid";
|
||||
|
||||
var CspStrategy = {}
|
||||
var CspStrategy: any = {}
|
||||
|
||||
var defaultDirectives = {
|
||||
defaultSrc: ['\'self\''],
|
||||
@ -86,8 +86,10 @@ function getCspNonce(req, res) {
|
||||
function addUpgradeUnsafeRequestsOptionTo(directives) {
|
||||
if (config.csp.upgradeInsecureRequests === 'auto' && config.useSSL) {
|
||||
directives.upgradeInsecureRequests = true
|
||||
} else if (config.csp.upgradeInsecureRequests === true) {
|
||||
directives.upgradeInsecureRequests = true
|
||||
} else { // @ts-ignore
|
||||
if (config.csp.upgradeInsecureRequests === true) {
|
||||
directives.upgradeInsecureRequests = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user