Getting a direct link to any image w/o HTTP auth


#1

I have my own dashboard on a tablet at home which displays random photos from owncloud. Dashboard has server and client side. Server-side gets all images from selected folders from webdav using xhr request (PROPFIND method). Client-side asks server for a list of images and embeds <img> tag with a random link.
As you need to authenticate with webdav on client-side, I used HTTP auth via user:pass directly in a link: login:pass@example.com/remote.php/webdav/photos/DSC03599.JPG. But as of Chrome 59, this feature was removed and now I get an error (blocked:origin).

What options do I see now:

  1. Make an xhr request, get its contents as data:uri and insert as src of the image: <img src="data:image/...">.
  2. Create some type of proxy on server side. I will ask it for an image url, it will make a request to owncloud with appropriate HTTP Auth headers and return response to client.

Both ways seem too complicated for me. I want something like:

Any suggestion?