ipfs/ipfs-companion
View on GitHubRight-click upload from cookie/token-guarded services fail
Open
#351 opened on Jan 6, 2018
P3help wantedkind/bugstatus/deferred
Description
This one is nit-picky, but nevertheless, decreases UX:
How to Reproduce
- Go to a service that has some guarded content. What I mean by that is if you copy URL to an image and paste it in "Incognito Mode" it will redirect you to login page. Lets use Slack as an example.
- Upload image to a private channel
- Right click on it and select "Upload to IPFS"
Current Behaviour
Slack's login page is added to IPFS instead of selected image 🙃
Desired Outcome
Selected image should be added to IPFS, as expected. 👌
Rationale: It would not decrease website's security: if user was able to display image, she can save it to the disk and then upload it to IPFS manually anyway. :trollface:
Potential Fix
My guess is that the bug is caused by ipfs.util.addFromURL doing internal fetch without proper credentials.
A fix would be to pass raw bytes/stream of right-clicked asset to one of ipfs.files.add* methods instead.