From 911c5293316410409708a17bf2ba996c83ea5a3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halvor=20Grizzly=20Bj=C3=B8rn?= Date: Wed, 15 Jan 2025 20:35:21 +0100 Subject: [PATCH] =?UTF-8?q?:alien:=20callId=20m=C3=A5=20v=C3=A6re=20satt?= =?UTF-8?q?=20for=20oppslag=20mot=20Saf=20selvbetjening?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/services/fetchProxy.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/services/fetchProxy.ts b/lib/services/fetchProxy.ts index b494864..9304a62 100644 --- a/lib/services/fetchProxy.ts +++ b/lib/services/fetchProxy.ts @@ -3,6 +3,7 @@ import { requestOboToken, validateToken } from '@navikt/oasis'; import { getAccessTokenOrRedirectToLogin, logError } from '@navikt/aap-felles-utils'; import { headers } from 'next/headers'; +import { randomUUID } from 'crypto'; const NUMBER_OF_RETRIES = 3; @@ -40,12 +41,14 @@ export const fetchProxy = async ( }; export const fetchPdf = async (url: string, scope: string): Promise => { + const callid = randomUUID(); const oboToken = await getOnBefalfOfToken(scope, url); const response = await fetch(url, { method: 'GET', headers: { Authorization: `Bearer ${oboToken}`, Accept: 'application/pdf', + 'Nav-CallId': callid, }, next: { revalidate: 0 }, });