-
Notifications
You must be signed in to change notification settings - Fork 964
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
URI::InvalidURIError (bad URI(is not URI?): #704
Comments
Did you try to remove the HTTParty.get("https://therapie-schorndorf.de/2001.zip") |
Can confirm without that space it works fine. However, many other URLs with a space also work fine. This works (of course it's a 404):
I've also noted this gives you a DNS lookup error - which appears to suggest it parsed the URI fine:
I've tried a series of alternatives but can't find a clear correlation as to what is wrong with the given URI. |
I think there is a correlation between the space ( |
Unfortunately this is also a bad URI: HTTParty.get("https://therapie-schorndorf.de/a%2001.zip") |
@technion did you try something like this: url = "https://therapie-schorndorf.de/a%2001.zip"
encoded_url = URI.encode(url)
HTTParty.get(encoded_url) It works for me. |
That "works" but i I believe that's the wrong URL. When run against my own domain and reviewing my own web server logs, it's encoded the % to %25 and then literally searched the file system for a file named a%2001.zip as opposed to "a 01.zip". |
Hi,
I know you've seen similar errors, I'm hoping this is somewhat different.
(I'm trying to fetch a virus infected website so please be careful with these links)
Consider the following:
This doesn't appear to be directly an issue with Ruby's parser:
irb(main):024:0> URI.parse("https://therapie-schorndorf.de/%2001")
=> #<URI::HTTPS https://therapie-schorndorf.de/%2001>
But more importantly, it doesn't appear to be an issue with the space. This is fine:
irb(main):025:0> HTTParty.get("https://google.com/%2001.zip")
I seem to be going in circles getting to the bottom of what exactly is invalid about this. I'm sure this used to work as I have hardcoded URIs in my app and my app worked a few months back. Any assistance appreciated.
The text was updated successfully, but these errors were encountered: