Skip to content
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

Response does not contain headers #365

Closed
kingyue737 opened this issue Feb 26, 2024 · 2 comments
Closed

Response does not contain headers #365

kingyue737 opened this issue Feb 26, 2024 · 2 comments

Comments

@kingyue737
Copy link

Environment


  • Operating System: Linux
  • Node Version: v18.18.0
  • Nuxt Version: 3.10.3
  • CLI Version: 3.10.1
  • Nitro Version: 2.8.1
  • Package Manager: [email protected]
  • Builder: -
  • User Config: devtools
  • Runtime Modules: -
  • Build Modules: -

Reproduction

stackblitz.com/edit/nuxt-starter-knny4w

Describe the bug

$fetch.raw returns a response without headers. It should contain headers.

Additional context

It's originally posted in #350 as a feature request but I think it is rather a bug so I am reposting it here with reproduction.

Logs

No response

@kingyue737
Copy link
Author

kingyue737 commented Feb 26, 2024

By the way, I have a question. Why ofetch has ofetch.native but $fetch in nuxt does not have $fetch.native?

@Lpmvb
Copy link

Lpmvb commented Feb 29, 2024

https://developer.mozilla.org/en-US/docs/Web/API/Response/headers

https://developer.mozilla.org/en-US/docs/Web/API/Headers

You can use Array.from(response.headers.keys()) to get all the keys, and headers.get(key) to get the values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants