BREAKING: update CSP configuration

Disable it by default and add ability to specify a custom report uri
This commit is contained in:
Chocobozzz 2019-02-21 16:27:32 +01:00
parent c8000975d3
commit 539d3f4faa
No known key found for this signature in database
GPG key ID: 583A612D890159BE
8 changed files with 36 additions and 19 deletions

View file

@ -55,13 +55,15 @@ app.set('trust proxy', CONFIG.TRUST_PROXY)
// Security middleware
import { baseCSP } from './server/middlewares'
app.use(baseCSP)
app.use(helmet({
frameguard: {
action: 'deny' // we only allow it for /videos/embed, see server/controllers/client.ts
},
hsts: false
}))
if (CONFIG.CSP.ENABLED) {
app.use(baseCSP)
app.use(helmet({
frameguard: {
action: 'deny' // we only allow it for /videos/embed, see server/controllers/client.ts
},
hsts: false
}))
}
// ----------- Database -----------