curl-trace-parser icon indicating copy to clipboard operation
curl-trace-parser copied to clipboard

Remove the octets numbers from the chunked response for blueprint output

Open eiri opened this issue 10 years ago • 3 comments

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.

eiri avatar Apr 29 '15 19:04 eiri

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?

netmilk avatar Apr 30 '15 17:04 netmilk

@eiri You still working on this?

bf4 avatar Aug 26 '16 13:08 bf4

@eiri Hi, would you have time to get back to this?

honzajavorek avatar Apr 13 '17 11:04 honzajavorek