Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

remove toString #326

Merged
merged 1 commit into from
Aug 15, 2016
Merged

remove toString #326

merged 1 commit into from
Aug 15, 2016

Conversation

nginnever
Copy link
Member

@nginnever nginnever commented Jun 17, 2016

I found that this was causing incorrect returns when writing the add http resource. JS-IPFS-API makes http requests to the js-ipfs object core now with the addition of the new add support for core here.

If the data is a string then the buffer is sent correctly, however if the data field is something else it seems to be wrapping the buffer with some extra maybe new line characters.

@diasdavid @dignifiedquire
Is there a specific reason for the data to be return as a string in the object/data http resource?

PR 323 Is blocked by this issue.

@hackergrrl
Copy link
Contributor

Could you add a test case? I'm curious what data causes this to break.

@nginnever
Copy link
Member Author

nginnever commented Jun 17, 2016

@noffle there is a test case of it failing here in the add http PR.

I'm looking into adding a direct test to object/data http-api test now.

The file otherconfig does not get the correct hash do to this issue. It's a plain text json doc while hello does get the correct data when toString() is applied. Could it be json plain text in a buffer being toString() that is the issue?

@dignifiedquire
Copy link
Member

We should make sure that this is always the same type of object (which toString did).

@daviddias
Copy link
Member

LGTM :)

@daviddias daviddias merged commit 17a0736 into master Aug 15, 2016
@daviddias daviddias deleted the object/http branch August 15, 2016 10:07
@daviddias daviddias removed the status/in-progress In progress label Aug 15, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants