Closed sebastianhelbig closed 7 years ago
I would love to see this get merged! We could really use it. github/fetch users, same exact problem as OP.
I went ahead and cut a new PR that addresses the PR concerns: https://github.com/pretenderjs/FakeXMLHttpRequest/pull/33
Great! Thanks. Closing this in favour of #33
In one of my projects we are using the github fetch polyfill (https://github.com/github/fetch) and setting a request Content-Type of
application/x-www-form-urlencoded
. In the polyfill code all custom set header names are made lowercase, this is according to specification (all header name are case insensitive (see: https://github.com/github/fetch/issues/249, https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2).Current status is that FakeXMLHttpRequest only checks for case sensitive
Content-Type
. So in my project we end up with two content-type headers, resulting in a combined, invalid content-type ofapplication/x-www-form-urlencoded, text/plain; charset=UTF-8
.This PR simply also checks for the lower-case variant.