settings headers in nuxt.config.js doesn't actually add the headers you set

meatherly
0
meatherly
commented 3 months ago

Version

v5.9.0

Reproduction link

https://github.com/meatherly/nuxtjs-axios-bug

Steps to reproduce

Set the common headers in the nuxt.config.js for the axios module. Then make a request with the axios module.

What is expected ?

It should merge the headers you add to the config with the default like the documentation says.

What is actually happening?

The headers are not changing.

Additional comments?

I've created a example repo to recreate the bug.

  • Start up the project.
  • Load the index page.
  • Inspect the request to https://jsonplaceholder.typicode.com/posts/1 in the dev tools.

You should see that the common header set in nuxt.config.js is missing from the request when it shouldn't be.

bug
0
MLDMoritz
0
MLDMoritz
commented 3 months ago

Probably duplicate of #311

0
Informations
Bug Report โ€ข Open
#c318 - Created 3 months ago