New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(nuxt): do not compute useFetch
key from headers (reverting #23462)
#24333
Conversation
Run & review this pull request in StackBlitz Codeflow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll need to update the tests as well - we can change them from headers -> query param tests.
nuxt/test/nuxt/composables.test.ts
Lines 259 to 273 in 5625327
/* @ts-expect-error Overriding auto-key */ | |
await useFetch('/api/test', { headers: { id: '3' } }, '') | |
/* @ts-expect-error Overriding auto-key */ | |
await useFetch('/api/test', { headers: { id: ref('3') } }, '') | |
const headers = new Headers() | |
headers.append('id', '3') | |
/* @ts-expect-error Overriding auto-key */ | |
await useFetch('/api/test', { headers }, '') | |
/* @ts-expect-error Overriding auto-key */ | |
await useFetch('/api/test', { headers: [['id', '3']] }, '') | |
/* @ts-expect-error Overriding auto-key */ | |
await useFetch('/api/test', { headers: [['id', ref('3')]] }, '') | |
/* @ts-expect-error Overriding auto-key */ | |
await useFetch('/api/test', { headers: [[computed(() => 'id'), '3']] }, '') | |
expect.soft(getPayloadEntries()).toBe(baseCount + 3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
useFetch
key from headers (reverting #23462)
π Linked issue
resolves #23900 #24321
Be related to #23462
β Type of change
π Description
π Checklist