From f8045a20dc224db190ce38a102d29318e6393d93 Mon Sep 17 00:00:00 2001 From: naruse Date: Tue, 5 Aug 2014 19:37:37 +0000 Subject: [PATCH] merge revision(s): 47079: [Backport #9129] * lib/net/http.rb (Net::HTTP.proxy_uri): use initializer instead of parser to handle IPv6 address. [Bug #9129] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ lib/net/http.rb | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 54bf2d5..e77e75c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Nov 20 16:22:30 2014 NARUSE, Yui + + * lib/net/http.rb (Net::HTTP.proxy_uri): use initializer instead + of parser to handle IPv6 address. [Bug #9129] + Wed Nov 19 10:19:36 2014 Eric Wong * vm_eval.c (rb_yield_splat): add missing GC guard diff --git a/lib/net/http.rb b/lib/net/http.rb index 973998f..a63be7f 100644 --- a/lib/net/http.rb +++ b/lib/net/http.rb @@ -1024,7 +1024,9 @@ module Net #:nodoc: # The proxy URI determined from the environment for this connection. def proxy_uri # :nodoc: - @proxy_uri ||= URI("http://#{address}:#{port}").find_proxy + @proxy_uri ||= URI::HTTP.new( + "http".freeze, nil, address, port, nil, nil, nil, nil, nil + ).find_proxy end # The address of the proxy server, if one is configured. -- 2.0.0