]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server.ts
Add request body limit
[github/Chocobozzz/PeerTube.git] / server.ts
index b501518595ac9d790297c488f28fcfe3d42a74cb..c450d5b6ece3a9707196373032774ba7859f1185 100644 (file)
--- a/server.ts
+++ b/server.ts
@@ -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 -----------