Skip to content

Commit 42134d8

Browse files
committed
test: explicit content type headers on infra client
1 parent 0edfd68 commit 42134d8

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/lib/clients/api.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,18 @@ import type { paths as InfraPaths } from '@/types/infra-api'
33

44
export const infra = createClient<InfraPaths>({
55
baseUrl: process.env.INFRA_API_URL,
6-
fetch: ({ url, headers, body, method, ...options }) => {
6+
credentials: 'include',
7+
fetch: ({ url, headers, body, method, credentials, ...options }) => {
8+
const modifiedHeaders = new Headers({
9+
'Content-Type': 'application/json',
10+
...headers,
11+
})
12+
713
return fetch(url, {
8-
headers,
14+
headers: modifiedHeaders,
915
body,
1016
method,
17+
credentials,
1118
...options,
1219
})
1320
},

0 commit comments

Comments
 (0)