Skip to content

Commit

Permalink
fix(nuxt): compute fetch cache key with headers (#23462)
Browse files Browse the repository at this point in the history
  • Loading branch information
hendrikheil authored and manniL committed Dec 11, 2023
1 parent 65e57d4 commit b05d274
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/nuxt/src/app/composables/fetch.ts
Expand Up @@ -85,7 +85,7 @@ export function useFetch<
return unref(r)
})

const _key = opts.key || hash([autoKey, unref(opts.method as MaybeRef<string | undefined> | undefined)?.toUpperCase() || 'GET', unref(opts.baseURL), typeof _request.value === 'string' ? _request.value : '', unref(opts.params || opts.query)])
const _key = opts.key || hash([autoKey, unref(opts.method as MaybeRef<string | undefined> | undefined)?.toUpperCase() || 'GET', unref(opts.baseURL), typeof _request.value === 'string' ? _request.value : '', unref(opts.params || opts.query), unref(opts.headers)])
if (!_key || typeof _key !== 'string') {
throw new TypeError('[nuxt] [useFetch] key must be a string: ' + _key)
}
Expand Down

0 comments on commit b05d274

Please sign in to comment.