I just hit this with an API I'm developing (...typos... 😫). 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?
🎩
I just hit this with an API I'm developing (...typos... 😫).
httpin node is unforgiving, so invalid headers throwHPE_INVALID_HEADER_TOKEN:The
http-parser-jslibrary 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?
🎩