From 434502c6785c1651a2e3d631dbde7f7833db8d22 Mon Sep 17 00:00:00 2001 From: Dominic Mazzoni Date: Sun, 25 Jun 2023 12:12:32 -0700 Subject: [PATCH] CSP should allow data urls for media-src or the audio captcha won't work --- src/server/middleware/set-default-csp.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/middleware/set-default-csp.ts b/src/server/middleware/set-default-csp.ts index a3ee5261..fd776ab6 100644 --- a/src/server/middleware/set-default-csp.ts +++ b/src/server/middleware/set-default-csp.ts @@ -3,7 +3,7 @@ import type { NextFunction, Response } from "express"; export default function ({ res, next }: { res: Response; next: NextFunction }) { res.setHeader( "Content-Security-Policy", - `default-src 'self'; manifest-src *; connect-src *; img-src * data:; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; form-action 'self'; base-uri 'self'; frame-src *; media-src *` + `default-src 'self'; manifest-src *; connect-src *; img-src * data:; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; form-action 'self'; base-uri 'self'; frame-src *; media-src * data:` ); next();