diff options
Diffstat (limited to 'server.ts')
-rw-r--r-- | server.ts | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -52,7 +52,25 @@ app.set('trust proxy', CONFIG.TRUST_PROXY) | |||
52 | // Security middlewares | 52 | // Security middlewares |
53 | app.use(helmet({ | 53 | app.use(helmet({ |
54 | frameguard: { | 54 | frameguard: { |
55 | action: 'deny' | 55 | action: 'deny' // we only allow it for /videos/embed, see server/controllers/client.ts |
56 | }, | ||
57 | dnsPrefetchControl: { | ||
58 | allow: true | ||
59 | }, | ||
60 | contentSecurityPolicy: { | ||
61 | directives: { | ||
62 | fontSrc: ["'self'"], | ||
63 | frameSrc: ["'none'"], | ||
64 | mediaSrc: ['*', 'https:'], | ||
65 | objectSrc: ["'none'"], | ||
66 | scriptSrc: ["'self'"], | ||
67 | styleSrc: ["'self'"], | ||
68 | upgradeInsecureRequests: true | ||
69 | }, | ||
70 | browserSniff: false // assumes a modern browser, but allows CDN in front | ||
71 | }, | ||
72 | referrerPolicy: { | ||
73 | policy: 'strict-origin-when-cross-origin' | ||
56 | } | 74 | } |
57 | })) | 75 | })) |
58 | 76 | ||