From 5d2e306bfd4030a5c27bd8a0b13da686db3a6b8a Mon Sep 17 00:00:00 2001 From: danielsdeleo Date: Fri, 15 Nov 2013 12:17:42 -0800 Subject: Backport URI::Generic#hostname to Ruby 1.9.2 and older MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Documentation for URI::Generic#host in Ruby 2.0.0 explains: Since IPv6 addresses are wrapped by brackets in URIs, this method returns IPv6 addresses wrapped by brackets. This form is not appropriate to pass socket methods such as TCPSocket.open. If unwrapped host names are required, use “hostname” method. Therefore the best way to support IPv6 URIs is to replace calls to URI::Generic#host with URI::Generic#hostname. The #hostname method is added in Ruby 1.9.3 so we need to backport it for older ruby versions. --- lib/chef.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/chef.rb') diff --git a/lib/chef.rb b/lib/chef.rb index 3e5394b141..0d5fb3de2c 100644 --- a/lib/chef.rb +++ b/lib/chef.rb @@ -37,3 +37,5 @@ require 'chef/monkey_patches/string' require 'chef/monkey_patches/numeric' require 'chef/monkey_patches/object' require 'chef/monkey_patches/file' +require 'chef/monkey_patches/uri' + -- cgit v1.2.1