driverdan / node-XMLHttpRequest

XMLHttpRequest for node.js
http://thedanexperiment.com/2009/10/04/emulating-xmlhttprequest-in-node-js/
MIT License
416 stars 299 forks source link

I suspect that content-type should be case insensitive #183

Open MichaelWehar opened 4 years ago

MichaelWehar commented 4 years ago

https://github.com/driverdan/node-XMLHttpRequest/blob/97966e4ca1c9f2cc5574d8775cbdacebfec75455/lib/XMLHttpRequest.js#L369

Currently, it appears that it assumes content-type is written as "Content-Type".

MichaelWehar commented 4 years ago

See here: https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2

"Field names are case-insensitive."

MythicManiac commented 4 years ago

I just hit a bug due to this, a client was setting content-type instead of the Content-Type that was being checked for, causing breakage.