gottfrois / link_thumbnailer

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

Some sites throw a redirection error #96

Open shenders13 opened 8 years ago

shenders13 commented 8 years ago

Some sites throw a redirection error

Thanks for your consideration in advance!

Sam

gottfrois commented 8 years ago

It seems to be an issue with cookies. The original URL returns a 302 with a Set-Cookie http header. The gem handle this http header correctly but even after the cookie is set, the site keeps returning 302 http responses.

I would need more time to investigate this. Also, I had plan to remove all that redirection home made logic and use another http client library such as faraday and typhoeus.

No quick fix i can think of right now unfortunately other than monkey patching on your side but with the effect of having some other website that will throw a redirect limit error as well because of cookie not set.