From 3bde91439a0b634ef26c79fc83219681d9a5a97c Mon Sep 17 00:00:00 2001 From: Hendrik Heil Date: Mon, 2 Oct 2023 12:31:38 +0200 Subject: [PATCH] fix(nuxt): compute fetch cache key with headers (#23462) --- packages/nuxt/src/app/composables/fetch.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nuxt/src/app/composables/fetch.ts b/packages/nuxt/src/app/composables/fetch.ts index 7e6371b2f7..c4c1d2b083 100644 --- a/packages/nuxt/src/app/composables/fetch.ts +++ b/packages/nuxt/src/app/composables/fetch.ts @@ -85,7 +85,7 @@ export function useFetch< return unref(r) }) - const _key = opts.key || hash([autoKey, unref(opts.method as MaybeRef | 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 | 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) }