Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Response body is empty if X-Chunked-Output header is set #696

Closed
@vmx

Description

@vmx

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions