feat: http upload/download progress handlers#54
Conversation
There was a problem hiding this comment.
Is there a way this can work in node too? Shim in xmlhttprequest (disclaimer - I've never used that module, just Googled it) or fall back to http from node core?
@achingbrain can we do this as a followup, so we could unblock webui ipfs/ipfs-webui#1534 ? |
I also looked at the linked library along with numerous others in on npm and it seems that none support upload / download progress events and in fact non that I have looked support node streams. node-fetch is particular in that regard that it switches We could fall back to plain |
|
@achingbrain I have added progress events for node as well, by wrapping around request body if |
|
Published in |
Fixes a regression introduced by #54 - in the browser by default the response body is interpreted as a string which can become corrupted when non-printable characters are encountered.
|
I think we might have to revert this - the upload/download progress handlers are useful but XHR has no way of doing streaming downloads so it's broken pubsub in the browser as it works via long-lived requests and the call to make the request doesn't return until the You can access partially loaded content via the @Gozala any ideas on this? |
This reverts commit d30be96.
As per #52 this adds
onUploadProgress/onDownloadProgressoptional handlers. Intention is to allow ipfs-webui to render file upload progress when new content is added.Fixes #52