Project

General

Profile

Bug #9974

Updated by nobu (Nobuyoshi Nakada) over 10 years ago

~~~ 
 $ ruby -v 
 ruby 2.2.0dev (2014-06-23 trunk 46517) [x86_64-darwin13] 
 $ ruby -ruri -e "puts URI.parse('http://test_example')" 
 http://test_example 
 ~~~ 

 Compare to Ruby 2.1.2: 

 
 ~~~ 
 $ ruby -v 
 ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0] 
 $ ruby -ruri -e "puts URI.parse('http://test_example')" 
 /Users/gabriel/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/uri/generic.rb:214:in `initialize': the scheme http does not accept registry part: test_example (or bad hostname?) (URI::InvalidURIError) 
         from /Users/gabriel/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/uri/http.rb:84:in `initialize' 
         from /Users/gabriel/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/uri/common.rb:214:in `new' 
         from /Users/gabriel/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/uri/common.rb:214:in `parse' 
         from /Users/gabriel/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/uri/common.rb:747:in `parse' 
         from -e:1:in `<main>' 
 ~~~ 

 This appears to be a regression as hostnames cannot legally contain underscores: http://en.wikipedia.org/wiki/Hostname#Restrictions%5Fon%5Fvalid%5Fhost%5Fnames 

Back