summaryrefslogtreecommitdiff
path: root/lib/chef/http
diff options
context:
space:
mode:
authordanielsdeleo <dan@opscode.com>2013-11-15 15:08:40 -0800
committerdanielsdeleo <dan@opscode.com>2013-11-15 15:08:40 -0800
commit43427bf41bcf07a04946b0a7435af78ec4955426 (patch)
treef964e9cfd4afb1c77cfb0acbd9a7b8584d7a9529 /lib/chef/http
parent5d2e306bfd4030a5c27bd8a0b13da686db3a6b8a (diff)
downloadchef-43427bf41bcf07a04946b0a7435af78ec4955426.tar.gz
Update HTTP usage for IPv6 Support
* Fixes Chef::HTTP related code to use URI::Generic#hostname when initializing Net::HTTP objects. * Replace RestClient usage in cookbook uploader with Chef::HTTP::Simple; RestClient has the same bug as is fixed in the Chef::HTTP code (and is difficult to fix with a monkey patch). See: https://github.com/rest-client/rest-client/blob/0919b02cc57447cf42a67e31aad87ab2a6929da3/lib/restclient/request.rb#L150 * Manually verified with chef-zero; chef-zero's test helper code does not expose the `:host` parameter so it cannot be used to bind the server to ::1. Integration tests will be added once this is solved.
Diffstat (limited to 'lib/chef/http')
-rw-r--r--lib/chef/http/basic_client.rb2
-rw-r--r--lib/chef/http/http_request.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/http/basic_client.rb b/lib/chef/http/basic_client.rb
index c3421703d5..05ac662b7c 100644
--- a/lib/chef/http/basic_client.rb
+++ b/lib/chef/http/basic_client.rb
@@ -47,7 +47,7 @@ class Chef
end
def host
- @url.host
+ @url.hostname
end
def port
diff --git a/lib/chef/http/http_request.rb b/lib/chef/http/http_request.rb
index ec837f13f2..e0ec2233b9 100644
--- a/lib/chef/http/http_request.rb
+++ b/lib/chef/http/http_request.rb
@@ -76,7 +76,7 @@ class Chef
end
def host
- @url.host
+ @url.hostname
end
def port