From 0d23eaba09a4878520bf346af4cead90d76829fc Mon Sep 17 00:00:00 2001 From: Madeline <46743919+MaddyUnderStars@users.noreply.github.com> Date: Sun, 25 Sep 2022 18:24:21 +1000 Subject: Refactor to mono-repo + upgrade packages --- api/src/middlewares/CORS.ts | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 api/src/middlewares/CORS.ts (limited to 'api/src/middlewares/CORS.ts') diff --git a/api/src/middlewares/CORS.ts b/api/src/middlewares/CORS.ts deleted file mode 100644 index 20260cf9..00000000 --- a/api/src/middlewares/CORS.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { NextFunction, Request, Response } from "express"; - -// TODO: config settings - -export function CORS(req: Request, res: Response, next: NextFunction) { - res.set("Access-Control-Allow-Origin", "*"); - // TODO: use better CSP - res.set( - "Content-security-policy", - "default-src * data: blob: filesystem: about: ws: wss: 'unsafe-inline' 'unsafe-eval'; script-src * data: blob: 'unsafe-inline' 'unsafe-eval'; connect-src * data: blob: 'unsafe-inline'; img-src * data: blob: 'unsafe-inline'; frame-src * data: blob: ; style-src * data: blob: 'unsafe-inline'; font-src * data: blob: 'unsafe-inline';" - ); - res.set("Access-Control-Allow-Headers", req.header("Access-Control-Request-Headers") || "*"); - res.set("Access-Control-Allow-Methods", req.header("Access-Control-Request-Methods") || "*"); - - next(); -} -- cgit 1.5.1