From: nagachika00@... Date: 2014-07-07T02:10:34+00:00 Subject: [ruby-core:63561] [ruby-trunk - Bug #9912] [Assigned] URI#to_s with an empty host formats the string incorrectly Issue #9912 has been updated by Tomoyuki Chikanaga. Status changed from Open to Assigned Assignee set to Yui NARUSE ---------------------------------------- Bug #9912: URI#to_s with an empty host formats the string incorrectly https://bugs.ruby-lang.org/issues/9912#change-47611 * Author: Maciek Sakrejda * Status: Assigned * Priority: Normal * Assignee: Yui NARUSE * Category: lib * Target version: * ruby -v: ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN ---------------------------------------- maciek@gamera:~$ ruby -e "puts URI.parse('postgres:///foo').to_s" postgres:/foo The string of the formatted URI should be 'postgres:///foo'. Postgres uses empty-host URIs to indicate a Unix socket connection should be used instead of a TCP connection (which is used if you specify 'localhost' as host), so this can be very useful. -- https://bugs.ruby-lang.org/