diff options
author | Jeremiah Snapp <jeremiah@getchef.com> | 2015-04-09 02:12:01 -0400 |
---|---|---|
committer | Jeremiah Snapp <jeremiah@getchef.com> | 2015-04-09 02:12:01 -0400 |
commit | 8bdc709430578b0423cdb27e5178de694af2fdd2 (patch) | |
tree | 9ebdf5cde9b1962a911919883ef419d2fa6cc5f2 | |
parent | 648c9f91d4a0ccbcf661a5ee4d3ec67d8538a5f3 (diff) | |
download | chef-jhs/fix_http_proxy.tar.gz |
Use user:password from http_proxy url firstjhs/fix_http_proxy
If the user and password are included in the http_proxy url
then use them.
Otherwise use the http_proxy_user and http_proxy_pass values.
-rw-r--r-- | lib/chef/http/basic_client.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/http/basic_client.rb b/lib/chef/http/basic_client.rb index f0f5151dbd..5fb7c20e80 100644 --- a/lib/chef/http/basic_client.rb +++ b/lib/chef/http/basic_client.rb @@ -132,8 +132,8 @@ class Chef Net::HTTP else Chef::Log.debug("Using #{http_proxy.host}:#{http_proxy.port} for proxy") - user = Chef::Config["#{url.scheme}_proxy_user"] - pass = Chef::Config["#{url.scheme}_proxy_pass"] + user = http_proxy.user || Chef::Config["#{url.scheme}_proxy_user"] + pass = http_proxy.password || Chef::Config["#{url.scheme}_proxy_pass"] Net::HTTP.Proxy(http_proxy.host, http_proxy.port, user, pass) end end |