Skip to content

Commit

Permalink
fix: error with header merging/serializations
Browse files Browse the repository at this point in the history
  • Loading branch information
kelsos committed Oct 8, 2024
1 parent 37f5c77 commit d57c319
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion utils/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,12 @@ export const fetchWithCsrf = $fetch.create({
'accept': 'application/json',
'content-type': 'application/json',
...(token && { [CSRF_HEADER]: token }),
...options?.headers,
};

for (const [key, value] of options.headers) {
headers[key] = value;
}

if (import.meta.server || process.env.NODE_ENV === 'test') {
const cookieString = event
? event.headers.get('cookie')
Expand Down

0 comments on commit d57c319

Please sign in to comment.