Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected X-Chunked-Output in /api/v0/version response #5711

Closed
lidel opened this issue Oct 31, 2018 · 1 comment
Closed

Unexpected X-Chunked-Output in /api/v0/version response #5711

lidel opened this issue Oct 31, 2018 · 1 comment

Comments

@lidel
Copy link
Member

lidel commented Oct 31, 2018

Version information:

0.4.18-rc1-f0bf99361

Type:

Bug

Description:

TL;DR response headers for /api/v0/version include unexpected X-Chunked-Output: 1 which breaks response parser in js-ipfs-api.

It is very likely caused by the same codepaths as #4721

💢 go-ipfs v0.4.18-rc1 + js-ipfs-api v26.1.0

Due to bogus header in go-ipfs response js-ipfs-api thinks the payload is a stream, so it creates a stream object from it internally which has no attributes of expected names, producing undefined values for end user:
2018-10-31--22-55-36

Response headers include unexpected X-Chunked-Output: 1:

HTTP/1.1 200 OK
Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length
Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length
Content-Type: application/json
Server: go-ipfs/0.4.18-rc1
Trailer: X-Stream-Error
Vary: Origin
X-Chunked-Output: 1
Date: Wed, 31 Oct 2018 21:47:29 GMT
Transfer-Encoding: chunked

Example of correct response (previous version):

🆗 go-ipfs v0.4.17 + js-ipfs-api v26.1.0

go-ipfs-version-ok-2018-10-31--21-47-31

Response headers:

HTTP/1.1 200 OK
Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length
Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length
Content-Type: application/json
Server: go-ipfs/0.4.17
Trailer: X-Stream-Error
Vary: Origin
Date: Wed, 31 Oct 2018 21:47:14 GMT
Transfer-Encoding: chunked

Just for the record, js-ipfs (also ok):

🆗 js-ipfs v0.32.3 + js-ipfs-api v26.1.0

js-ipfs-version-ok-2018-10-31--21-47-31

Response headers:

HTTP/1.1 200 OK
access-control-allow-headers: X-Stream-Output, X-Chunked-Output, X-Content-Length
access-control-expose-headers: X-Stream-Output, X-Chunked-Output, X-Content-Length
vary: origin,accept-encoding
content-type: application/json; charset=utf-8
cache-control: no-cache
content-encoding: gzip
Date: Wed, 31 Oct 2018 21:52:50 GMT
Connection: keep-alive
Transfer-Encoding: chunked
@magik6k
Copy link
Member

magik6k commented Oct 31, 2018

Already fixed in #5697

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants