typhoeus / typhoeus

Typhoeus wraps libcurl in order to make fast and reliable requests.
http://rubydoc.info/github/typhoeus/typhoeus
MIT License
4.08k stars 435 forks source link

Why does a url with "#" returns 404 in Heroku? #438

Open luccasmaso opened 9 years ago

luccasmaso commented 9 years ago

I'm testing these 2 valid urls http://www.businessinsider.com.au/smartphone-impact-brain-body-sleep-2015-2 http://www.businessinsider.com.au/smartphone-impact-brain-body-sleep-2015-2#ooid=BvMjVqcjoHdZBG6tTpXy8UkhB5_46U_c

Running the code below for both, the first one returns 200 OK, but the second one returns 404.

request = Typhoeus::Request.new(url, followlocation: true)
request.on_headers do |response|
   puts response.code
end
request.run

Cannot have idea of this behavior. Maybe is some escaping problem witth #?

If I make a little replace of the # to ?, it works http://www.businessinsider.com.au/smartphone-impact-brain-body-sleep-2015-2?ooid=BvMjVqcjoHdZBG6tTpXy8UkhB5_46U_c

Thanks

luccasmaso commented 9 years ago

Well, actually doing some more tests, this problem only occurs no production environment in my case on heroku. What heroku has to do with it?

hanshasselberg commented 9 years ago

It probably has another libcurl version.

luccasmaso commented 9 years ago

Yes, probably it is. Found the same problem here https://github.com/typhoeus/ethon/issues/93