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

return a json object from config show #5345

Merged
merged 1 commit into from
Aug 15, 2018
Merged

return a json object from config show #5345

merged 1 commit into from
Aug 15, 2018

Conversation

Stebalien
Copy link
Member

@Stebalien Stebalien commented Aug 6, 2018

This doesn't change there CLI output, it just means that the server responds with a JSON output by default.

Fixes #5335.

@Stebalien Stebalien requested a review from Kubuxu as a code owner August 6, 2018 20:31
@ghost ghost assigned Stebalien Aug 6, 2018
@ghost ghost added the status/in-progress In progress label Aug 6, 2018
@Stebalien Stebalien added need/review Needs a review and removed status/in-progress In progress labels Aug 6, 2018
@Stebalien
Copy link
Member Author

@diasdavid is this likely to break something?

This doesn't change there CLI output, it just means that the server responds
with a JSON output by default.

fixes #5335

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
@Stebalien
Copy link
Member Author

So, this does cause a bit of an issue: Users using old clients against newer servers won't see nicely formatted json, they'll see dense json. However, I'm not too concerned about that. Clients with this patch applied still work correctly against older servers.

@whyrusleeping
Copy link
Member

This seems fine to me, but I would double check with the javascripters before merging.

@Stebalien
Copy link
Member Author

@hacdias or @alanshaw, thoughts?

@hacdias
Copy link
Member

hacdias commented Aug 11, 2018

If the Content-Type header is now application/json instead of plain/text, the js-ipfs-api will still work as expected.

@Stebalien
Copy link
Member Author

It is. These are the old 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: text/plain
< Server: go-ipfs/0.4.18-dev
< Trailer: X-Stream-Error
< Vary: Origin
< X-Stream-Output: 1
< Date: Sat, 11 Aug 2018 16:44:20 GMT
< Transfer-Encoding: chunked

These are the new 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.18-dev
< Trailer: X-Stream-Error
< Vary: Origin
< Date: Sat, 11 Aug 2018 16:46:12 GMT
< Transfer-Encoding: chunked

Note that the X-Stream-Output header is also gone.

@hacdias
Copy link
Member

hacdias commented Aug 11, 2018

Great @Stebalien ! 😄

@Kubuxu
Copy link
Member

Kubuxu commented Aug 14, 2018

We should test it out against js-ipfs-api to be 100% sure. We should probably also test out go-ipfs-api and java-ipfs-api. This is touchy change as it changes a default behaviour.

@Stebalien
Copy link
Member Author

@Kubuxu looks like this'll work just fine with js-ipfs-api as js-ipfs already behaves this way.

@Stebalien
Copy link
Member Author

I'll take the comments from @hacdias and @whyrusleeping as "two signoffs".

@Stebalien Stebalien merged commit 3d1802f into master Aug 15, 2018
@daviddias daviddias deleted the fix/5335 branch August 15, 2018 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/review Needs a review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants