Project

General

Profile

Actions

Bug #28756

open

URI.host does not unwrap IPv6 bracket notation

Added by Lukas Zapletal almost 5 years ago. Updated almost 5 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

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.


Related issues 1 (1 open0 closed)

Related to Foreman - Tracker #28683: IPv6 only supportNew

Actions
Actions #1

Updated by Lukas Zapletal almost 5 years ago

Actions #2

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

Also available in: Atom PDF