From 49af1a47e277d518a55d4a54e7244def3ba54400 Mon Sep 17 00:00:00 2001 From: VaiTon Date: Tue, 20 Feb 2024 19:11:41 +0100 Subject: [PATCH] Add CSP --- svelte.config.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/svelte.config.js b/svelte.config.js index 9d47d05..bfc8eab 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -11,7 +11,20 @@ const config = { // adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list. // If your environment is not supported or you settled on a specific environment, switch out the adapter. // See https://kit.svelte.dev/docs/adapters for more information about adapters. - adapter: adapter() + adapter: adapter(), + csp: { + directives: { + 'script-src': ['self', 'https://va.vercel-scripts.com/'], + 'img-src': [ + 'self', + 'data:', + 'https://*.openfoodfacts.org/', + 'https://tile.openstreetmap.org' + ], + 'style-src': ['self', 'unsafe-inline'], + 'frame-ancestors': ['none'] + } + } } };