nuxt / devtools

Unleash Nuxt Developer Experience
https://devtools.nuxt.com
MIT License
2.79k stars 154 forks source link

fix: GET request are called with `application/json` value in Content-Type #691

Open filipfdevelit opened 5 days ago

filipfdevelit commented 5 days ago

🐛 The bug

DevTools are adding Content-Type header with application/json value to GET requests.

According to RFC 7231:

A payload within a GET request message has no defined semantics; sending a payload body on a GET request might cause some existing implementations to reject the request.

GET request shouldn't be sending a body thus application/json value doesn't fit.

🛠ī¸ To reproduce

https://github.com/filipfdevelit/repl-nuxt-dev-tools-content-type-get-request

🌈 Expected behavior

DevTools are not adding application/json to Content-Type header for GET requests.

ℹī¸ Additional context

No response