Remove the octets numbers from the chunked response for blueprint output
Chunked transfer encoding format includes the number of the octets of the data in each chunk as a part of the response.
This commit adds detection of the Transfer-Encoding: chunked
into the parser to strip the numbers from the output for blueprint
format. The output of raw format kept not modified.
This fix probably also resolves issue apiaryio/curl-trace-parser#6.
Hi @eiri, it's awesome that you're using curl-trace-parser and thank you very much for the contribution!
I'm happy to merge it, but can you please add a tracefile to the fixtures for this particular situation and add a simple test for it? It will help to keep this feature maintained in the future and to don't brake it. :)
Also I think that some servers can send transfer-encoding header with capital T and E, so it will not match the regexp.
An I suggest to do this action on the parsed HTTP response instead of blob data in parsed response, because there is an access to parsed headers, so it shouldn't be implemented with use of regex but with plain JS equation. What you think?
@eiri You still working on this?
@eiri Hi, would you have time to get back to this?