Skip to content

Commit 8746203

Browse files
authored
fix(custom-fetch): update to new ofetch headers implementation (#101)
1 parent 771153d commit 8746203

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Diff for: examples/advanced/use-custom-fetch-composable/plugins/customFetch.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ export default defineNuxtPlugin(() => {
77
onRequest({ request, options, error }) {
88
if (userAuth.value) {
99
// Add Authorization header
10-
options.headers = options.headers || {}
11-
options.headers.Authorization = `Bearer ${userAuth.value}`
10+
options.headers.set('Authorization', `Bearer ${userAuth.value}`)
1211
}
1312
},
1413
onResponse({ response }) {

0 commit comments

Comments
 (0)