Case-insensitive header field names
The RFC 7230 3.2 and also the old RFC 2616 4.2 define the field name as case-insensitive. node-fetch sends the content-length header field in lower case. That means the web server doesn't go into that if branch. I tested it with a quick 'n dirty or condition. I would like to make a PR. I think a generic solution, calling .toLowerCase() after this line would be the best solution, but that would also cause changes in many other places in the code and maybe even applications that use the web server library. What do you prefer?
this is a good point. I did put some thought on it, no clear resolution in my mind :) You have methods for getting, searching and adding headers and I am not sure how all that will play out and what is the best way to deal with it.
Even applications that use the web server library should deal with field names as case-insensitive, so providing the names in lower case only fashion could be useful. Not sure about it, though.
+1 for toLowerCase in the library.
It neatly forces some standards compliance on my code
maybe equalsIgnoreCase should be used throughout the lib so case would not matter. I do not really want to force either situation.
Should be resolved in the above commit