ipfs/ipfs-companion

Right-click upload from cookie/token-guarded services fail

Open

#351 opened on Jan 6, 2018

View on GitHub
 (0 comments) (1 reaction) (0 assignees)JavaScript (1,992 stars) (364 forks)batch import
P3help wantedkind/bugstatus/deferred

Description

This one is nit-picky, but nevertheless, decreases UX:

How to Reproduce

  1. 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.
  2. Upload image to a private channel
  3. 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.

Contributor guide