From: "rgr (Ricardo Ramalho)" Date: 2013-09-12T01:17:29+09:00 Subject: [ruby-core:57140] [ruby-trunk - Bug #8898][Open] NET::HTTP always raises an exception if http_proxy="" (empty string) Issue #8898 has been reported by rgr (Ricardo Ramalho). ---------------------------------------- Bug #8898: NET::HTTP always raises an exception if http_proxy="" (empty string) https://bugs.ruby-lang.org/issues/8898 Author: rgr (Ricardo Ramalho) Status: Open Priority: Normal Assignee: Category: Target version: ruby -v: ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux] Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN The new URI::Generic.find_proxy code uses this environment variable, even if it's set to "". I believe it should test if it's "", and behave as if there was no proxy (nil if ""). Previous rubies behave as expected, ignoring http_proxy="" (only tested 1.9.3, 1.9.2 and ree-1.8.7) http_proxy="" rvm use ruby 2.0.0 exec ruby -e 'require "net/http"; p Net::HTTP::Proxy(nil, nil).new("www.google.com", 80).get("/")' /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:883:in `initialize': getaddrinfo: Name or service not known (SocketError) from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:883:in `open' from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:883:in `block in connect' from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/timeout.rb:52:in `timeout' from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:882:in `connect' from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:864:in `do_start' from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:853:in `start' from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:1372:in `request' from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:1131:in `get' from -e:1:in `
' http_proxy="" rvm use ruby 1.9.3 exec ruby -e 'require "net/http"; p Net::HTTP::Proxy(nil, nil).new("www.google.com", 80).get("/")' # http_proxy="" rvm use ruby 1.9.2 exec ruby -e 'require "net/http"; p Net::HTTP::Proxy(nil, nil).new("www.google.com", 80).get("/")' # http_proxy="" rvm use ree-1.8.7 exec ruby -e 'require "net/http"; p Net::HTTP::Proxy(nil, nil).new("www.google.com", 80).get("/")' # -- http://bugs.ruby-lang.org/