From 6d0c02b80f8495700ea198a2fcd1185b5b91138c Mon Sep 17 00:00:00 2001 From: Gard Opsahl Skaare Date: Fri, 1 Nov 2024 13:40:55 +0100 Subject: [PATCH] feat(familie-backend/headers.ts): legg til Nav telemetry URL-er i CSP headers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Nødvendig for å samle inn telemetri i appene våre --- packages/familie-backend/src/headers.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/familie-backend/src/headers.ts b/packages/familie-backend/src/headers.ts index cc7f86537..1f64ab778 100644 --- a/packages/familie-backend/src/headers.ts +++ b/packages/familie-backend/src/headers.ts @@ -5,8 +5,10 @@ const fontSource = 'https://fonts.gstatic.com'; const navFontSource = 'https://cdn.nav.no'; const amplitude = 'https://amplitude.nav.no'; const sentry = 'https://sentry.gc.nav.no'; +const navTelemetry = 'https://telemetry.nav.no'; +const navTelemetryDev = 'https://telemetry.ekstern.dev.nav.no'; -const cspString = `default-src 'self' data: ${amplitude} ${sentry}; style-src 'self' ${styleSource} data: 'unsafe-inline'; font-src 'self' ${fontSource} ${navFontSource} data:; frame-src 'self' blob:;`; +const cspString = `default-src 'self' data: ${amplitude} ${sentry} ${navTelemetry} ${navTelemetryDev}; style-src 'self' ${styleSource} data: 'unsafe-inline'; font-src 'self' ${fontSource} ${navFontSource} data:; frame-src 'self' blob:;`; const setup = (app: Express) => { app.disable('x-powered-by');