fetch
fetch copied to clipboard
fix: ignore not throw on invalid response headers
@JakeChampion I think the fix is fine, however I struggle with the test. It runs into the same problem that the response headers are validated. But I can't figure out which package supplies this code. None of the node_modules
has a _http_outgoing.js
that I could monkey-patch for this one response to not validate the response headers.
I also can't just test parseHeaders()
since its private and not globally exported (rightfully so).
So do you have any idea how to test my fix properly?
Fixes #930
_http_outgoing.js
is part of the built-in NodeJS http module, it is not possible to set a response header name in an invalid format with the built-in NodeJS http module.
The only way I can think to test this, would be to use another language to create a http server which can set a response header name in an invalid format. From the issue, we know that golang is able to do that.
I'm also happy to accept this pull-request without a test
I’m working on mocking xhr to Test this.
What is going on here? I am working on adding a test with mocked xhr and then put it in "Ready for review". So for the time being no more approvals needed. And please github clean up the spam here, thanks ;)