mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-08 09:34:16 +00:00
Fix CSP in dev mode (#1918)
This commit is contained in:
parent
7a804ff333
commit
5d4edf555e
|
@ -8,7 +8,7 @@
|
|||
"scripts": {
|
||||
"analyze": "webpack --mode=none",
|
||||
"prebuild:dev": "yarn clean && node generate_translations.js",
|
||||
"build:dev": "webpack --env LEMMY_UI_DISABLE_CSP=true --env COMMIT_HASH=$(git rev-parse --short HEAD) --mode=development",
|
||||
"build:dev": "webpack --env COMMIT_HASH=$(git rev-parse --short HEAD) --mode=development",
|
||||
"prebuild:prod": "yarn clean && node generate_translations.js",
|
||||
"build:prod": "webpack --env COMMIT_HASH=$(git rev-parse --short HEAD) --mode=production",
|
||||
"clean": "yarn run rimraf dist",
|
||||
|
|
|
@ -29,7 +29,11 @@ server.use(
|
|||
);
|
||||
server.use(setCacheControl);
|
||||
|
||||
if (!process.env["LEMMY_UI_DISABLE_CSP"] && !process.env["LEMMY_UI_DEBUG"]) {
|
||||
if (
|
||||
!process.env["LEMMY_UI_DISABLE_CSP"] &&
|
||||
!process.env["LEMMY_UI_DEBUG"] &&
|
||||
process.env["NODE_ENV"] !== "development"
|
||||
) {
|
||||
server.use(setDefaultCsp);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue