diff --git a/backend/src/main.ts b/backend/src/main.ts index 1c984b9..7495f47 100644 --- a/backend/src/main.ts +++ b/backend/src/main.ts @@ -19,7 +19,18 @@ process.on('unhandledRejection', (reason: any) => { async function bootstrap() { const app = await NestFactory.create(AppModule); - app.use(helmet()); + app.use(helmet({ + contentSecurityPolicy: { + directives: { + defaultSrc: ["'self'"], + scriptSrc: ["'self'", "'unsafe-inline'"], + styleSrc: ["'self'", "'unsafe-inline'"], + imgSrc: ["'self'", "data:", "blob:"], + connectSrc: ["'self'", "ws:", "wss:"], + fontSrc: ["'self'", "data:"], + }, + }, + })); app.setGlobalPrefix('api'); app.useGlobalPipes(new ValidationPipe({ whitelist: true, transform: true })); app.useWebSocketAdapter(new WsAdapter(app));