mistweaverco / kulala.nvim

A minimal 🤏 HTTP-client 🐼 interface 🖥️ for Neovim ❤️.
https://kulala.mwco.app
MIT License
304 stars 5 forks source link

Header names shouldn't be case sensitive #10

Closed t-eichmann closed 3 weeks ago

t-eichmann commented 3 weeks ago

I just spend quite some time trying to figure out why the JSON content of a response would not be formatted and the filetype is set to plaintext instead. As it turned out the problem was that I set in my request a capitalized header field. This formats the output and sets the correct filetype:

GET https://api.isevenapi.xyz(api/iseven/12/
accept: application/json

This does not:

GET https://api.isevenapi.xyz(api/iseven/12/
Accept: application/json

According to the spec https://www.rfc-editor.org/rfc/rfc9110.html#name-field-names header fields are case-insensitive, so capitalizing them, as is quite common, should not lead to such problems.

gorillamoe commented 3 weeks ago

You're right, I'll fix that.