From d7a8660952970f3596309384489961bdd651191b Mon Sep 17 00:00:00 2001 From: eternal-flame-AD Date: Fri, 22 Nov 2024 09:37:41 -0600 Subject: [PATCH] set connect-src for sw.js Signed-off-by: eternal-flame-AD --- packages/backend/src/server/web/ClientServerService.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/backend/src/server/web/ClientServerService.ts b/packages/backend/src/server/web/ClientServerService.ts index 8dcd76ee71..54c608ac9e 100644 --- a/packages/backend/src/server/web/ClientServerService.ts +++ b/packages/backend/src/server/web/ClientServerService.ts @@ -503,6 +503,7 @@ export class ClientServerService { // ServiceWorker fastify.get('/sw.js', async (request, reply) => { + reply.header('content-security-policy', `default-src \'self'; connect-src \'self\'${ this.config.mediaProxy ? ` ${new URL(this.config.mediaProxy).origin}` : '' }`); return await reply.sendFile('/sw.js', swAssets, { maxAge: ms('10 minutes'), });