summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorayumin <ayumin@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-03 07:21:56 +0000
committerayumin <ayumin@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-03 07:21:56 +0000
commit68f7424bdeb9a8ec6e91e94937fe7cc72f8b890c (patch)
tree7c99af7bfcbb9075c2aec4c2ec2a86ff7d4583b0 /lib
parentce80a49f38ce90951bbecf225103aa2291287921 (diff)
* 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
Diffstat (limited to 'lib')
-rw-r--r--lib/net/http.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/net/http.rb b/lib/net/http.rb
index 37b6b82..ddb4fe8 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