[ruby-core:111427] [Ruby master Bug#19258] URI::Generic#host returns empty string instead of nil

Issue #19258 has been reported by janko (Janko Marohnić). ---------------------------------------- Bug #19258: URI::Generic#host returns empty string instead of nil https://bugs.ruby-lang.org/issues/19258 * Author: janko (Janko Marohnić) * Status: Open * Priority: Normal * ruby -v: ruby 3.2.0 (2022-12-25 revision a528908271) [arm64-darwin22] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- On Ruby 3.1, `URI::Generic#host` would return `nil` for `unix:///` URLs, but on Ruby 3.2 it now returns an empty string: ```rb uri = URI.parse("unix:///var/run/docker.sock") uri.host #=> # Ruby 3.1: nil # Ruby 3.2: "" ``` This introduced a regression in the Excon gem, which currently doesn't handle these URLs on Ruby 3.2, because it [aborts](https://github.com/excon/excon/blob/efd48747fe6c6fa959e787aa5949241cd762f8f3...) for UNIX URLs when `:host` is not `nil`. -- https://bugs.ruby-lang.org/

Issue #19258 has been updated by hsbt (Hiroshi SHIBATA). This is the intentional change. See https://hackerone.com/reports/156615 ---------------------------------------- Bug #19258: URI::Generic#host returns empty string instead of nil https://bugs.ruby-lang.org/issues/19258#change-100799 * Author: janko (Janko Marohnić) * Status: Open * Priority: Normal * ruby -v: ruby 3.2.0 (2022-12-25 revision a528908271) [arm64-darwin22] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- On Ruby 3.1, `URI::Generic#host` would return `nil` for `unix:///` URLs, but on Ruby 3.2 it now returns an empty string: ```rb uri = URI.parse("unix:///var/run/docker.sock") uri.host #=> # Ruby 3.1: nil # Ruby 3.2: "" ``` This introduced a regression in the Excon gem, which currently doesn't handle these URLs on Ruby 3.2, because it [aborts](https://github.com/excon/excon/blob/efd48747fe6c6fa959e787aa5949241cd762f8f3...) for UNIX URLs when `:host` is not `nil`. -- https://bugs.ruby-lang.org/

Issue #19258 has been updated by janko (Janko Marohnić). Thanks or the update, makes sense, I will try to get Excon updated then. ---------------------------------------- Bug #19258: URI::Generic#host returns empty string instead of nil https://bugs.ruby-lang.org/issues/19258#change-100800 * Author: janko (Janko Marohnić) * Status: Open * Priority: Normal * ruby -v: ruby 3.2.0 (2022-12-25 revision a528908271) [arm64-darwin22] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- On Ruby 3.1, `URI::Generic#host` would return `nil` for `unix:///` URLs, but on Ruby 3.2 it now returns an empty string: ```rb uri = URI.parse("unix:///var/run/docker.sock") uri.host #=> # Ruby 3.1: nil # Ruby 3.2: "" ``` This introduced a regression in the Excon gem, which currently doesn't handle these URLs on Ruby 3.2, because it [aborts](https://github.com/excon/excon/blob/efd48747fe6c6fa959e787aa5949241cd762f8f3...) for UNIX URLs when `:host` is not `nil`. -- https://bugs.ruby-lang.org/

Issue #19258 has been updated by hsbt (Hiroshi SHIBATA). Status changed from Open to Closed Thanks for trying Ruby 3.2 quickly. ---------------------------------------- Bug #19258: URI::Generic#host returns empty string instead of nil https://bugs.ruby-lang.org/issues/19258#change-100801 * Author: janko (Janko Marohnić) * Status: Closed * Priority: Normal * ruby -v: ruby 3.2.0 (2022-12-25 revision a528908271) [arm64-darwin22] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- On Ruby 3.1, `URI::Generic#host` would return `nil` for `unix:///` URLs, but on Ruby 3.2 it now returns an empty string: ```rb uri = URI.parse("unix:///var/run/docker.sock") uri.host #=> # Ruby 3.1: nil # Ruby 3.2: "" ``` This introduced a regression in the Excon gem, which currently doesn't handle these URLs on Ruby 3.2, because it [aborts](https://github.com/excon/excon/blob/efd48747fe6c6fa959e787aa5949241cd762f8f3...) for UNIX URLs when `:host` is not `nil`. -- https://bugs.ruby-lang.org/
participants (2)
-
hsbt (Hiroshi SHIBATA)
-
janko