Skip to content

Commit

Permalink
CSP
Browse files Browse the repository at this point in the history
  • Loading branch information
mei23 committed Aug 24, 2021
1 parent b168c13 commit 9b06f70
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/server/file/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import sendDriveFile from './send-drive-file';
// Init app
const app = new Koa();
app.use(cors());
app.use(async (ctx, next) => {
ctx.set('Content-Security-Policy', `default-src 'none'; style-src 'unsafe-inline'`);
await next();
});

// Init router
const router = new Router();
Expand Down
4 changes: 4 additions & 0 deletions src/server/proxy/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ import { proxyMedia } from './proxy-media';
// Init app
const app = new Koa();
app.use(cors());
app.use(async (ctx, next) => {
ctx.set('Content-Security-Policy', `default-src 'none'; style-src 'unsafe-inline'`);
await next();
});

// Init router
const router = new Router();
Expand Down

0 comments on commit 9b06f70

Please sign in to comment.