Updated tests/test-headers.js to test for the case this PR addresses.
If the following conditions were met it would result in the content-type header always being "text/plain;charset=UTF-8":
The method is not GET or HEAD
Data is being sent
When setting the content-type header, the key used is anything other than a case-sensitive "Content-Type"
I encountered it when sending a POST request with xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');, then was surprised by the server receiving the content-type as text/plain.
Updated
tests/test-headers.js
to test for the case this PR addresses.If the following conditions were met it would result in the content-type header always being "text/plain;charset=UTF-8":
I encountered it when sending a POST request with
xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
, then was surprised by the server receiving the content-type astext/plain
.