mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-13 04:37:36 +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
|
||||
app.use(helmet({
|
||||
// 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,
|
||||
permittedCrossDomainPolicies: false,
|
||||
referrerPolicy: false,
|
||||
|
||||
Reference in New Issue
Block a user