mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 06:37:23 +01:00
feat(security): implement CSP
This commit is contained in:
@@ -66,7 +66,19 @@ export default function attachMiddlewares (app, server) {
|
|||||||
// See https://helmetjs.github.io/ for the list of headers enabled by default
|
// See https://helmetjs.github.io/ for the list of headers enabled by default
|
||||||
app.use(helmet({
|
app.use(helmet({
|
||||||
// New middlewares added by default in Helmet 4 are disabled
|
// New middlewares added by default in Helmet 4 are disabled
|
||||||
contentSecurityPolicy: false, // @TODO implement
|
contentSecurityPolicy: {
|
||||||
|
directives: {
|
||||||
|
imgSrc: null,
|
||||||
|
scriptSrc: [
|
||||||
|
'\'self\'',
|
||||||
|
'cloudfront.loggly.com',
|
||||||
|
'js.stripe.com',
|
||||||
|
'm.stripe.network',
|
||||||
|
'static-na.payments-amazon.com',
|
||||||
|
],
|
||||||
|
upgradeInsecureRequests: IS_PROD ? [] : null,
|
||||||
|
},
|
||||||
|
},
|
||||||
expectCt: false,
|
expectCt: false,
|
||||||
permittedCrossDomainPolicies: false,
|
permittedCrossDomainPolicies: false,
|
||||||
referrerPolicy: false,
|
referrerPolicy: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user