diff options
author | ayumin <ayumin@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-01-03 07:21:56 +0000 |
---|---|---|
committer | ayumin <ayumin@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-01-03 07:21:56 +0000 |
commit | 68f7424bdeb9a8ec6e91e94937fe7cc72f8b890c (patch) | |
tree | 7c99af7bfcbb9075c2aec4c2ec2a86ff7d4583b0 | |
parent | ce80a49f38ce90951bbecf225103aa2291287921 (diff) | |
download | ruby-68f7424bdeb9a8ec6e91e94937fe7cc72f8b890c.tar.gz |
* 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
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | lib/net/http.rb | 12 |
2 files changed, 16 insertions, 2 deletions
@@ -1,3 +1,9 @@ +Sat Jan 3 16:02:20 2015 Ayumu AIZAWA <ayumu.aizawa@gmail.com> + + * lib/net/http.rb (Net::HTTP.proxy_user): retrieve proxy user from http_proxy. + * lib/net/http.rb (Net::HTTP.proxy_pass): retrieve proxy password from http_proxy. + Patch by Rafael dos Santos Silva. [fix GH-763] + Sat Jan 3 11:50:16 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com> * ext/openssl/ossl.h: avoid to build failure of Windows environment. 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 |