Skip to content

HTTPS clone URL

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://google.com/åäö') 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
View
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

@yatish27

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

@christianhellsten

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.

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