From d0967ef43c6d67a90320f236027157556a9fcee8 Mon Sep 17 00:00:00 2001 From: Sam Taylor Date: Wed, 7 Aug 2013 17:23:06 +0100 Subject: [PATCH] if the URI type for a proxy is generic, reparse with the current scheme --- lib/contrib/uri_ext.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/contrib/uri_ext.rb b/lib/contrib/uri_ext.rb index c1229e8..7337ca5 100644 --- a/lib/contrib/uri_ext.rb +++ b/lib/contrib/uri_ext.rb @@ -278,6 +278,9 @@ def read(options = nil, &block) def connect if proxy = proxy_uri proxy = URI.parse(proxy) if String === proxy + if URI::Generic === proxy + proxy = URI("#{scheme}://#{proxy.to_s}") + end http = Net::HTTP.new(host, port, proxy.host, proxy.port, proxy.user, proxy.password) else http = Net::HTTP.new(host, port)