diff options
author | danielsdeleo <dan@opscode.com> | 2013-11-15 12:17:42 -0800 |
---|---|---|
committer | danielsdeleo <dan@opscode.com> | 2013-11-15 12:17:42 -0800 |
commit | 5d2e306bfd4030a5c27bd8a0b13da686db3a6b8a (patch) | |
tree | b7fae4b6b79c1959ededae8501dd68df995ae91e /lib/chef/cookbook_uploader.rb | |
parent | ecbc917ac5496f3138b798332ea66f477c33f8ba (diff) | |
download | chef-5d2e306bfd4030a5c27bd8a0b13da686db3a6b8a.tar.gz |
Backport URI::Generic#hostname to Ruby 1.9.2 and older
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.
Diffstat (limited to 'lib/chef/cookbook_uploader.rb')
0 files changed, 0 insertions, 0 deletions