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

feat: Add urls directly. #121

Merged
merged 4 commits into from
Nov 17, 2015
Merged

Conversation

dignifiedquire
Copy link
Contributor

Closes #109

@@ -63,6 +64,10 @@ function IpfsAPI (host_or_multiaddr, port) {
opts = {}
}

if (typeof files === 'string' && files.startsWith('http')) {
files = request(files)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sync call will block the loop (or am I missing some ES6 thing?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The request is a stream object, so it will not block but will be piped into the new request effectively as far as I understand :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

`23:09 <+daviddias> dignifiedquire: interesting, so our thing understands 'strings', 'paths', 'buffers' and 'streams' too?``

Sweet!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better add a test and docs for adding with a stream though, otherwise that might change in the future and then we don't realize what broke the add by url was actually the lack of add by stream

@dignifiedquire
Copy link
Contributor Author

@diasdavid all fixed and done, ready for consumption :)

@daviddias
Copy link
Contributor

woot!! :D @jbenet , you have the thing you requested #109

@daviddias daviddias closed this Nov 17, 2015
@daviddias daviddias reopened this Nov 17, 2015
daviddias added a commit that referenced this pull request Nov 17, 2015
@daviddias daviddias merged commit 6e99795 into ipfs-inactive:master Nov 17, 2015
@dignifiedquire dignifiedquire deleted the add-http branch November 17, 2015 23:01
@jbenet
Copy link
Contributor

jbenet commented Nov 19, 2015

Thanks I love you. ❤️❤️❤️❤️❤️❤️❤️

Cool thing coming soon.
On Tue, Nov 17, 2015 at 15:01 David Dias notifications@github.com wrote:

Merged #121 #121.


Reply to this email directly or view it on GitHub
#121 (comment).

@dignifiedquire dignifiedquire mentioned this pull request Nov 23, 2015
53 tasks
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.

4 participants