mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/open-uri.rb (URI::Generic#find_proxy): return nil on loopback
address. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c9c51009cf
commit
678e4ea5b4
2 changed files with 13 additions and 1 deletions
|
@ -1,4 +1,7 @@
|
|||
Mon Feb 2 00:01:19 2004 Tanaka Akira <akr@m17n.org>
|
||||
Mon Feb 2 00:28:54 2004 Tanaka Akira <akr@m17n.org>
|
||||
|
||||
* lib/open-uri.rb (URI::Generic#find_proxy): return nil on loopback
|
||||
address.
|
||||
|
||||
* lib/resolv-replace.rb (BasicSocket#send): don't replace because
|
||||
it has no hostname argument.
|
||||
|
|
|
@ -488,6 +488,15 @@ module URI
|
|||
proxy_uri = ENV[name] || ENV[name.upcase]
|
||||
end
|
||||
|
||||
if proxy_uri && self.host
|
||||
require 'socket'
|
||||
begin
|
||||
addr = IPSocket.getaddress(self.host)
|
||||
proxy_uri = nil if /\A127\.|\A::1\z/ =~ addr
|
||||
rescue SocketError
|
||||
end
|
||||
end
|
||||
|
||||
if proxy_uri
|
||||
proxy_uri = URI.parse(proxy_uri)
|
||||
unless URI::HTTP === proxy_uri
|
||||
|
|
Loading…
Reference in a new issue