summaryrefslogtreecommitdiff
path: root/lib/chef/monkey_patches/net_http.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/monkey_patches/net_http.rb')
-rw-r--r--lib/chef/monkey_patches/net_http.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/chef/monkey_patches/net_http.rb b/lib/chef/monkey_patches/net_http.rb
index 6aad6029c3..eeb9def6df 100644
--- a/lib/chef/monkey_patches/net_http.rb
+++ b/lib/chef/monkey_patches/net_http.rb
@@ -21,7 +21,7 @@ module Net
end
end
-if Net::HTTP.instance_methods.map {|m| m.to_s}.include?("proxy_uri")
+if Net::HTTP.instance_methods.map { |m| m.to_s }.include?("proxy_uri")
begin
# Ruby 2.0 changes the way proxy support is implemented in Net::HTTP.
# The implementation does not work correctly with IPv6 literals because it
@@ -49,12 +49,10 @@ if Net::HTTP.instance_methods.map {|m| m.to_s}.include?("proxy_uri")
Net::HTTP.new("::1", 80).proxy_uri
rescue URI::InvalidURIError
class Net::HTTP
-
def proxy_uri # :nodoc:
ipv6_safe_addr = address.to_s.include?(":") ? "[#{address}]" : address
@proxy_uri ||= URI("http://#{ipv6_safe_addr}:#{port}").find_proxy
end
-
end
end
end