gottfrois / link_thumbnailer

Ruby gem that fetches images and metadata from a given URL. Much like popular social website with link preview.
MIT License
512 stars 106 forks source link

Demo Server failing due to CORS! #149

Closed epugh closed 2 years ago

epugh commented 3 years ago

I wanted to try out the demo server, to see how this worked, but am getting CORS errors:

Access to XMLHttpRequest at 'https://link-thumbnailer-demo.herokuapp.com/thumbnails/?url=https:%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D0XFudmaObLI' from origin 'http://link-thumbnailer-demo.herokuapp.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
application-815d29aa8aa8487e3d9574406ba21c1d5242a877c1295cd205110d6ee29ed626.js:13 Object
gottfrois commented 3 years ago

From the demo page our are you using this URL on your web app directly?

epugh commented 3 years ago

I am on Firefox, and I tried https://www.opensourceconnections.com and getting the same thing. I am directly on the demo server:

image

gottfrois commented 3 years ago

It just works for me but looking at your screenshot, you are not on the HTTPS version of the demo.

epugh commented 3 years ago

Of course! I tried it out in IRB and it worked.

You might be interested in this PR for a project I steward, where I am wrestling with the same issue ;-)

https://github.com/o19s/quepid/pull/431