Bug #6057

Updated by mame (Yusuke Endoh) over 1 year ago

The behavior of Ruby's URI is confusing, to say the least. 

 URI("") + "baz" 
 # => #<URI::HTTP:0x710713de URL:>  

 URI.join("", "bar") 
 # => #<URI::HTTP:0x29fd5dc4 URL:> 

 I could at least understand this behavior being the case if we were adding "/bar" (although it'd still be non-intuitive). That URI throws away its current path makes it a tedious library. Net::HTTP expects it as an input, yet as you interact with URI, you are constantly massaging it into and out of string form. 

 In my opinion, URI should model the behavior of Pathname.