mirror of
https://github.com/sasjs/server.git
synced 2026-01-06 22:20:06 +00:00
Merge pull request #165 from sasjs/issue-164
fix: helmet config on http mode
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -11,3 +11,4 @@ sasjscore/
|
|||||||
certificates/
|
certificates/
|
||||||
executables/
|
executables/
|
||||||
.env
|
.env
|
||||||
|
api/csp.config.json
|
||||||
|
|||||||
@@ -35,9 +35,12 @@ export const cookieOptions = {
|
|||||||
maxAge: 24 * 60 * 60 * 1000 // 24 hours
|
maxAge: 24 * 60 * 60 * 1000 // 24 hours
|
||||||
}
|
}
|
||||||
|
|
||||||
const cspConfigJson = getEnvCSPDirectives(HELMET_CSP_CONFIG_PATH)
|
const cspConfigJson: { [key: string]: string[] | null } = getEnvCSPDirectives(
|
||||||
|
HELMET_CSP_CONFIG_PATH
|
||||||
|
)
|
||||||
const coepFlag =
|
const coepFlag =
|
||||||
HELMET_COEP === 'true' || HELMET_COEP === undefined ? true : false
|
HELMET_COEP === 'true' || HELMET_COEP === undefined ? true : false
|
||||||
|
if (PROTOCOL === 'http') cspConfigJson['upgrade-insecure-requests'] = null
|
||||||
|
|
||||||
/***********************************
|
/***********************************
|
||||||
* CSRF Protection *
|
* CSRF Protection *
|
||||||
|
|||||||
Reference in New Issue
Block a user