diff --git a/src/server.ts b/src/server.ts index 71ff734..b339c0b 100644 --- a/src/server.ts +++ b/src/server.ts @@ -36,7 +36,15 @@ createConnection(connectionOptions).then(async () => { const app = new Koa(); // Provides important security headers to make your app more secure - app.use(helmet()); + app.use(helmet.contentSecurityPolicy({ + directives:{ + defaultSrc:["'self'"], + scriptSrc:["'self'", "'unsafe-inline'", "cdnjs.cloudflare.com"], + styleSrc:["'self'", "'unsafe-inline'", "cdnjs.cloudflare.com", "fonts.googleapis.com"], + fontSrc:["'self'","fonts.gstatic.com"], + imgSrc:["'self'", "data:", "online.swagger.io", "validator.swagger.io"] + } + })); // Enable cors with default options app.use(cors());