Project

General

Profile

Backport #8898

NET::HTTP always raises an exception if http_proxy="" (empty string)

Added by rgr (Ricardo Ramalho) almost 6 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
[ruby-core:57140]

Description

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("/")'
#

Associated revisions

Revision 80d82164
Added by naruse (Yui NARUSE) almost 6 years ago

  • lib/uri/generic.rb (URI::Generic.find_proxy): return nil if http_proxy environment variable is empty string. [ruby-core:57140] [Bug #8898]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 42930
Added by naruse (Yui NARUSE) almost 6 years ago

  • lib/uri/generic.rb (URI::Generic.find_proxy): return nil if http_proxy environment variable is empty string. [ruby-core:57140] [Bug #8898]

Revision 42930
Added by naruse (Yui NARUSE) almost 6 years ago

  • lib/uri/generic.rb (URI::Generic.find_proxy): return nil if http_proxy environment variable is empty string. [ruby-core:57140] [Bug #8898]

Revision 42930
Added by naruse (Yui NARUSE) almost 6 years ago

  • lib/uri/generic.rb (URI::Generic.find_proxy): return nil if http_proxy environment variable is empty string. [ruby-core:57140] [Bug #8898]

Revision 42930
Added by naruse (Yui NARUSE) almost 6 years ago

  • lib/uri/generic.rb (URI::Generic.find_proxy): return nil if http_proxy environment variable is empty string. [ruby-core:57140] [Bug #8898]

Revision 42930
Added by naruse (Yui NARUSE) almost 6 years ago

  • lib/uri/generic.rb (URI::Generic.find_proxy): return nil if http_proxy environment variable is empty string. [ruby-core:57140] [Bug #8898]

Revision 42930
Added by naruse (Yui NARUSE) almost 6 years ago

  • lib/uri/generic.rb (URI::Generic.find_proxy): return nil if http_proxy environment variable is empty string. [ruby-core:57140] [Bug #8898]

Revision b5ad2a59
Added by nagachika (Tomoyuki Chikanaga) almost 6 years ago

merge revision(s) 42930: [Backport #8898]

    * lib/uri/generic.rb (URI::Generic.find_proxy): return nil if
      http_proxy environment variable is empty string.
      [ruby-core:57140] [Bug #8898]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@43062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 43062
Added by nagachika (Tomoyuki Chikanaga) almost 6 years ago

merge revision(s) 42930: [Backport #8898]

* lib/uri/generic.rb (URI::Generic.find_proxy): return nil if
  http_proxy environment variable is empty string.
  [ruby-core:57140] [Bug #8898]

History

#1

Updated by naruse (Yui NARUSE) almost 6 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r42930.
Ricardo, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • lib/uri/generic.rb (URI::Generic.find_proxy): return nil if http_proxy environment variable is empty string. [ruby-core:57140] [Bug #8898]

Updated by nagachika (Tomoyuki Chikanaga) almost 6 years ago

  • Backport changed from 1.9.3: UNKNOWN, 2.0.0: UNKNOWN to 1.9.3: DONTNEED, 2.0.0: REQUIRED
#3

Updated by nagachika (Tomoyuki Chikanaga) almost 6 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby master to Backport200
  • Status changed from Closed to Assigned
  • Assignee set to nagachika (Tomoyuki Chikanaga)
#4

Updated by nagachika (Tomoyuki Chikanaga) almost 6 years ago

  • Status changed from Assigned to Closed

This issue was solved with changeset r43062.
Ricardo, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 42930: [Backport #8898]

* lib/uri/generic.rb (URI::Generic.find_proxy): return nil if
  http_proxy environment variable is empty string.
  [ruby-core:57140] [Bug #8898]

Also available in: Atom PDF