summaryrefslogtreecommitdiff
path: root/src/server/proxy/index.ts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2021-08-24 13:08:20 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2021-08-24 13:08:20 +0900
commit9d3448c880c0b2b3fec2f8acf68cf4cc472ee81a (patch)
tree59c2cf87d8495408a35eda8e9b0a8b2d54792a10 /src/server/proxy/index.ts
parentrefactoring (diff)
downloadsharkey-9d3448c880c0b2b3fec2f8acf68cf4cc472ee81a.tar.gz
sharkey-9d3448c880c0b2b3fec2f8acf68cf4cc472ee81a.tar.bz2
sharkey-9d3448c880c0b2b3fec2f8acf68cf4cc472ee81a.zip
fix(server): use csp to imporve security
Diffstat (limited to 'src/server/proxy/index.ts')
-rw-r--r--src/server/proxy/index.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/server/proxy/index.ts b/src/server/proxy/index.ts
index 9ef198d31b..b8993f19f8 100644
--- a/src/server/proxy/index.ts
+++ b/src/server/proxy/index.ts
@@ -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();