Skip to content

Commit

Permalink
Sette på headers
Browse files Browse the repository at this point in the history
  • Loading branch information
frodehansen2 committed Nov 24, 2023
1 parent 79804f4 commit 822f4df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apps/dine-pleiepenger/src/server/fetchApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export async function fetchApi<ResponseObject>(

const response = await fetch(fetchUrl, {
method: method.type,
body: method.type === 'POST' ? method.body : undefined,
// body: method.type === 'POST' ? method.body : undefined,
headers: {
Authorization: `Bearer ${tokenX}`,
'Content-Type': 'application/json',
Expand Down
6 changes: 6 additions & 0 deletions apps/dine-pleiepenger/src/server/fetchDocumentStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ export async function fetchDocumentStream(

const response = await axios.get(fetchUrl, {
responseType: 'stream',
headers: {
Authorization: `Bearer ${tokenX}`,
'Content-Type': 'application/pdf',
'x-request-id': context.requestId,
'X-K9-Brukerdialog': serverEnv.NAIS_CLIENT_ID!,
},
});

return response.data;
Expand Down

0 comments on commit 822f4df

Please sign in to comment.