diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2016-08-11 13:46:05 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2016-08-11 13:46:05 -0700 |
commit | 01211298359487b5a18657c8b289efc8eeeb13cd (patch) | |
tree | 89285c4ed71a27e16be3f36ae2c7b7cdfaa90905 /lib | |
parent | 8208d088a4bba794dbf5a0d5b39e1732edc2aec4 (diff) | |
download | chef-01211298359487b5a18657c8b289efc8eeeb13cd.tar.gz |
test Chef::HTTP and tweak cache
this is mildly awful, but works around the String-vs-URI crap
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/http.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/chef/http.rb b/lib/chef/http.rb index 04256b7510..ec6665f5c0 100644 --- a/lib/chef/http.rb +++ b/lib/chef/http.rb @@ -237,8 +237,12 @@ class Chef @http_client ||= {} # the per-host per-port cache here gets peristent connections correct when # redirecting to different servers - @http_client[base_url.host] ||= {} - @http_client[base_url.host][base_url.port] ||= build_http_client(base_url) + if base_url.is_a?(String) # sigh, this kind of abuse can't happen with strongly typed languages + @http_client[base_url] ||= build_http_client(base_url) + else + @http_client[base_url.host] ||= {} + @http_client[base_url.host][base_url.port] ||= build_http_client(base_url) + end else build_http_client(base_url) end |