From 68f7424bdeb9a8ec6e91e94937fe7cc72f8b890c Mon Sep 17 00:00:00 2001 From: ayumin Date: Sat, 3 Jan 2015 07:21:56 +0000 Subject: * lib/net/http.rb (proxy_user): retrieve proxy user from http_proxy. * lib/net/http.rb (proxy_pass): retrieve proxy password from http_proxy. Patch by Rafael dos Santos Silva. [fix GH-763] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/net/http.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/net/http.rb b/lib/net/http.rb index 37b6b82694..ddb4fe8c6a 100644 --- a/lib/net/http.rb +++ b/lib/net/http.rb @@ -1059,12 +1059,20 @@ module Net #:nodoc: # The proxy username, if one is configured def proxy_user - @proxy_user + if @proxy_from_env then + proxy_uri && proxy_uri.user + else + @proxy_user + end end # The proxy password, if one is configured def proxy_pass - @proxy_pass + if @proxy_from_env then + proxy_uri && proxy_uri.password + else + @proxy_pass + end end alias proxyaddr proxy_address #:nodoc: obsolete -- cgit v1.2.3