From: Dominic Mazzoni Date: Sun, 25 Jun 2023 19:12:32 +0000 (-0700) Subject: CSP should allow data urls for media-src or the audio captcha won't work X-Git-Url: http://these/git/%7B%60%24%7BghostArchiveUrl%7D/static/README.ja.md?a=commitdiff_plain;h=434502c6785c1651a2e3d631dbde7f7833db8d22;p=lemmy-ui.git CSP should allow data urls for media-src or the audio captcha won't work --- diff --git a/src/server/middleware/set-default-csp.ts b/src/server/middleware/set-default-csp.ts index a3ee526..fd776ab 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();