Headers used for the Local API aren't of HTTP standard (All Lower Caps)

Hi,i was using bond controller for using it on Node.js application. Turns out the API didn’t seem to work when I tried to use it with any sort of header. (Can work the /v2/token/ without issue, but not others).

I used Postman and Insomnia to test the the API’s and they do seem to work there, but then i realized something while looking at the calls made. Turns out, When used with Node.js and http package (Comes with node), The headers seem to convert to lower cases, (Now the HTTP requests recommend to use case-insensitive headers. They convert all headers to lower caps for case-insensitivity.)

So, I had to look for other packages for that. But this might be a good time to remind to make sure the header implementations are as per the HTTP standards (all lower caps), so whoever is using the API’s in future need not have to struggle as i had to…

@datathecodie interesting… this is Node’s http package’s default behavior? Thanks for the info, we’ll make header parsing case-insensitive

This is fixed in v2.6.23 firmware: we now accept any case for http headers (and methods) (will be available on next release.)

2 Likes