Closed ExEr7um closed 11 months ago
Similarly, there is a bug that if you set baseURL
in useFetch
, you cannot change the request header using Headers
.
cc: @pi0
@ExEr7um have you tried with v3.8.1?
Yes, this was resolved in https://github.com/nuxt/nuxt/pull/23884. Thank you for investigating @darioferderber ❤️
Yes, now it works correctly. Thanks!
Environment
Darwin
v20.8.1
3.8.0
3.9.1
2.7.0
pnpm@8.9.2
-
$production
,app
,appConfig
,experimental
,fontLoader
,gtag
,i18n
,image
,imports
,modules
,partytown
,piniaPersistedstate
,postcss
,router
,runtimeConfig
,sitemap
,svgo
,tailwindcss
,vue
@formkit/auto-animate/nuxt@0.8.0
,@funken-studio/sitemap-nuxt-3@4.0.4
,@nuxt/image@1.0.0
,@nuxtjs/i18n@8.0.0-rc.5
,@nuxtjs/partytown@1.3.0
,@nuxtjs/robots@3.0.0
,@nuxtjs/tailwindcss@6.8.0
,@pinia-plugin-persistedstate/nuxt@1.1.2
,@pinia/nuxt@0.5.1
,@vueuse/motion/nuxt@2.0.0
,@vueuse/nuxt@10.5.0
,@pacific-agency/nuxt-utils@0.13.3
,nuxt-font-loader@2.3.4
,nuxt-headlessui@1.1.4
,nuxt-icon@0.5.0
,nuxt-svgo@3.5.5
,nuxt-gtag@1.1.1
,nuxt-vitest@0.11.0
-
Reproduction
Tried to make it, but I think StackBlitz doesn't proxy browser headers on request.
Describe the bug
I'm using
Accept-Language
header to get localized data from API. There is strange behavior on SSR when usingbaseURL
.With
baseURL
I make a request like this:
On server side it proxies headers from browser and merges them with my provided header, so what I get is:
But on client side it replaces browser headers with mine, so I get:
Without
baseURL
I make the same request without using
baseURL
:That way, there is no error, both on client and on server side it replaces browser headers with mine. So the issue only happens when using
baseURL
. So I get:Additional context
No response
Logs
No response