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): ENV case sensitivity test
refined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5026 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0452420e4c
commit
922dc8265f
2 changed files with 18 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Tue Nov 25 18:56:06 2003 Tanaka Akira <akr@m17n.org>
|
||||||
|
|
||||||
|
* lib/open-uri.rb (URI::Generic#find_proxy): ENV case sensitivity test
|
||||||
|
refined.
|
||||||
|
|
||||||
Tue Nov 25 18:13:30 2003 Minero Aoki <aamine@loveruby.net>
|
Tue Nov 25 18:13:30 2003 Minero Aoki <aamine@loveruby.net>
|
||||||
|
|
||||||
* test/fileutils/test_fileutils.rb: chdir Dir.tmpdir before each
|
* test/fileutils/test_fileutils.rb: chdir Dir.tmpdir before each
|
||||||
|
|
|
@ -458,9 +458,19 @@ module URI
|
||||||
# HTTP_PROXY conflicts with *_proxy for proxy settings and
|
# HTTP_PROXY conflicts with *_proxy for proxy settings and
|
||||||
# HTTP_* for header informatin in CGI.
|
# HTTP_* for header informatin in CGI.
|
||||||
# So it should be careful to use it.
|
# So it should be careful to use it.
|
||||||
case_sentsitive = /djgpp|bccwin32|mingw|mswin32|mswince|emx/ !~ RUBY_PLATFORM
|
pairs = ENV.reject {|k, v| /\Ahttp_proxy\z/i !~ k }
|
||||||
if case_sentsitive
|
case pairs.length
|
||||||
# http_proxy is safe to use.
|
when 0 # no proxy setting anyway.
|
||||||
|
proxy_uri = nil
|
||||||
|
when 1
|
||||||
|
k, v = pairs[0]
|
||||||
|
if k == 'http_proxy' && ENV[k.upcase] == nil
|
||||||
|
# http_proxy is safe to use becase ENV is case sensitive.
|
||||||
|
proxy_uri = ENV[name]
|
||||||
|
else
|
||||||
|
proxy_uri = nil
|
||||||
|
end
|
||||||
|
else # http_proxy is safe to use becase ENV is case sensitive.
|
||||||
proxy_uri = ENV[name]
|
proxy_uri = ENV[name]
|
||||||
end
|
end
|
||||||
if !proxy_uri
|
if !proxy_uri
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue