Actions
Bug #28756
openURI.host does not unwrap IPv6 bracket notation
Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Description
URI implementation in Ruby does not convert IPv6 bracket notation to plain IPv6 address, in other words it does not remove those brackets. We often use URI class to parse input and then uri.host is used to construct other URI/URL or directly connect to hostname/IP. This will fail if the URI had IPv6 notation. This behavior will not be changed in ruby as discussed in https://bugs.ruby-lang.org/issues/3788 and new method called "hostname" was introduced instead to unwrap IPv6 brackets:
> u = URI.parse("http://[fd00:aaaa:bbbb:cc::1]:8888")
=> #<URI::HTTP http://[fd00:aaaa:bbbb:cc::1]:8888>
> u.host
=> "[fd00:aaaa:bbbb:cc::1]"
> u.hostname
=> "fd00:aaaa:bbbb:cc::1"
We need to replace all "uri.host" to "uri.hostname" in Foreman, Katello and other plugins.
Updated by Lukas Zapletal almost 5 years ago
- Related to Tracker #28683: IPv6 only support added
Updated by Lukas Zapletal almost 5 years ago
WORKAROUND for IPv6 testing: Do not use IPv6 address but a DNS/hostname instead for proxy.
Actions