lib/retriever/target.rb in rubyretriever-1.2.3 vs lib/retriever/target.rb in rubyretriever-1.2.4
- old
+ new
@@ -9,10 +9,10 @@
attr_reader :host, :target, :host_re, :source, :file_re, :scheme
def initialize(url, file_re = nil)
fail 'Bad URL' unless url.include?('.')
url = "http://#{url}" unless HTTP_RE =~ url
- target_uri = Addressable::URI.parse(url)
+ target_uri = Addressable::URI.parse(Addressable::URI.encode(url))
@target = target_uri.to_s
@host = target_uri.host
@host_re = Regexp.new(@host.sub('www.', ''))
@file_re ||= file_re
@scheme = target_uri.scheme