Response body is empty if X-Chunked-Output header is set #696
Description
When the X-Chunked-Output: 1
header is set, then the body of a HTTP request isn't passed along correctly.
Line 34 in send-request.js it's responsible for a different code path is X-Chunked-Output: 1
is set. This relates to ipfs/kubo#4721.
If this code path is taken then there's no streamToJsonValue
transformation taken (https://github.com/ipfs/js-ipfs-api/blob/de8d97c953447b605e2a1de68d198b5372419724/src/utils/send-request.js#L68). The send()
at https://github.com/ipfs/js-ipfs-api/blob/de8d97c953447b605e2a1de68d198b5372419724/src/utils/send-files-stream.js#L112-L148 has a DestroyableTransform
as response
. When the code reaches line 113, it does contain the expected body. But that body doesn't make it to here: https://github.com/maxogden/concat-stream/blob/e482281642c1e011fc158f5749ef40a71c77a426/index.js#L36.
As opposed to the code path when X-Chunked-Output
is not set. Then the body at https://github.com/maxogden/concat-stream/blob/e482281642c1e011fc158f5749ef40a71c77a426/index.js#L36 contains the expected value.