Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix for URI::InvalidURIError: bad URI(is not URI?). For example, URI('h…

…ttp://åäö') fails otherwise.
  • Loading branch information...
commit 2cfda4a8f5db9d883e3f385d768dafda520eee33 1 parent 57a58bc
@christianhellsten authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/anemone/http.rb
2  lib/anemone/http.rb
@@ -112,7 +112,7 @@ def get(url, referer = nil)
response, response_time = get_response(loc, referer)
code = Integer(response.code)
- redirect_to = response.is_a?(Net::HTTPRedirection) ? URI(response['location']).normalize : nil
+ redirect_to = response.is_a?(Net::HTTPRedirection) ? URI(URI.escape(response['location'])).normalize : nil
yield response, code, loc, redirect_to, response_time
limit -= 1
end while (loc = redirect_to) && allowed?(redirect_to, url) && limit > 0

3 comments on commit 2cfda4a


Hey even i used to get this error . i hope this should solve the issue


This is a quick-fix and most likely doesn't solve all issues. Using the Addressable gem instead of Ruby's URI would be a better solution, but requires more work.

Please sign in to comment.
Something went wrong with that request. Please try again.