hippie
hippie copied to clipboard
Fixing `HPE_INVALID_HEADER_TOKEN` complaints
I just hit this with an API I'm developing (...typos... :tired_face:). http
in node is unforgiving, so invalid headers throw HPE_INVALID_HEADER_TOKEN
:
{ [Error: Parse Error] bytesParsed: 163, code: 'HPE_INVALID_HEADER_TOKEN' }
The http-parser-js
library is more forgiving.
The ideal situation would be that when there is a malformed header in the response, that a test style error could be thrown--rather than an end of the world sort of thing.
Thoughts? :tophat: