Skip to content
This repository has been archived by the owner. It is now read-only.

addFromURL fails to follow redirections #513

Closed
maxlath opened this issue Jan 23, 2017 · 3 comments · Fixed by #514
Closed

addFromURL fails to follow redirections #513

maxlath opened this issue Jan 23, 2017 · 3 comments · Fixed by #514

Comments

@maxlath
Copy link
Contributor

maxlath commented Jan 23, 2017

ipfs.util.addFromURL('http://covers.openlibrary.org/book/id/969165.jpg')

will return the hash of an empty file (QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH instead of the expected QmaL9zy7YUfvWmtD5ZXp42buP7P4xmZJWFkm78p8FJqgjg) because request.js doesn't follow redirections

@maxlath
Copy link
Contributor Author

maxlath commented Jun 4, 2017

@diasdavid would it be acceptable to introduce a new dependency such as follow-redirects to solve this issue?

@daviddias
Copy link
Contributor

daviddias commented Jun 17, 2017

@maxlath looks promising! My first question was to make sure to check the deps it would bring and the increase in bundle size, but after skimming through follow-redirects, it seems it is the most compact solution we could use :) Move ahead! Thank you.

@daviddias daviddias added backlog and removed ready labels Jun 20, 2017
@daviddias daviddias removed the bug label Jul 26, 2017
@daviddias
Copy link
Contributor

daviddias commented Jul 26, 2017

Work happening at #514

maxlath added a commit to maxlath/js-ipfs-api that referenced this issue Jul 28, 2017
daviddias pushed a commit that referenced this issue Aug 6, 2017
* Make url-add follow HTTP redirections
fix #513

* Check status code before following a redirection

* http redirection: added a test

* test: make lint pass by handling the error
@momack2 momack2 added this to Backlog in ipfs/js-ipfs May 10, 2019
@momack2 momack2 added this to Backlog in ipfs/js-waffle May 10, 2019
@hsanjuan hsanjuan removed this from Backlog in ipfs/js-ipfs Apr 27, 2020
@hsanjuan hsanjuan removed this from Backlog in ipfs/js-waffle Apr 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants