Add csp for API

This commit is contained in:
Ajay Ramachandran
2021-05-06 16:03:26 -04:00
parent b0a4b6ebed
commit cd66399049
2 changed files with 8 additions and 0 deletions

6
src/middleware/apiCsp.ts Normal file
View File

@@ -0,0 +1,6 @@
import {NextFunction, Request, Response} from 'express';
export function apiCspMiddleware(req: Request, res: Response, next: NextFunction) {
res.header("Content-Security-Policy", "script-src 'none'");
next();
}