mirror of https://github.com/Chocobozzz/PeerTube
(quickfix) loosening CSP
parent
62945f067b
commit
aa1c3d929f
19
server.ts
19
server.ts
|
@ -59,12 +59,13 @@ app.use(helmet({
|
||||||
},
|
},
|
||||||
contentSecurityPolicy: {
|
contentSecurityPolicy: {
|
||||||
directives: {
|
directives: {
|
||||||
fontSrc: ["'self'"],
|
defaultSrc: ['*', 'data:', 'wss:', 'https:'],
|
||||||
|
fontSrc: ["'self'", 'data:'],
|
||||||
frameSrc: ["'none'"],
|
frameSrc: ["'none'"],
|
||||||
mediaSrc: ['*', 'https:'],
|
mediaSrc: ['*', 'https:'],
|
||||||
objectSrc: ["'none'"],
|
objectSrc: ["'none'"],
|
||||||
scriptSrc: ["'self'"],
|
scriptSrc: ["'self'", "'unsafe-inline'", "'unsafe-eval'"],
|
||||||
styleSrc: ["'self'"],
|
styleSrc: ["'self'", "'unsafe-inline'"],
|
||||||
upgradeInsecureRequests: true
|
upgradeInsecureRequests: true
|
||||||
},
|
},
|
||||||
browserSniff: false // assumes a modern browser, but allows CDN in front
|
browserSniff: false // assumes a modern browser, but allows CDN in front
|
||||||
|
@ -73,6 +74,18 @@ app.use(helmet({
|
||||||
policy: 'strict-origin-when-cross-origin'
|
policy: 'strict-origin-when-cross-origin'
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
app.use((_, res, next) => {
|
||||||
|
[
|
||||||
|
"vibrate 'none'",
|
||||||
|
"geolocation 'none'",
|
||||||
|
"camera 'none'",
|
||||||
|
"microphone 'none'",
|
||||||
|
"magnetometer 'none'",
|
||||||
|
"payment 'none'",
|
||||||
|
"accelerometer 'none'"
|
||||||
|
].forEach(e => res.append('Feature-Policy', e + ';'))
|
||||||
|
next()
|
||||||
|
})
|
||||||
|
|
||||||
// ----------- Database -----------
|
// ----------- Database -----------
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue