# Does this URI.parse http:/ bug has been fixed in Ruby 1.9?

**URL:** <https://www.ruby-forum.com/t/does-this-uri-parse-http-bug-has-been-fixed-in-ruby-1-9/130924>\
**Category:** Ruby\
**Created:** [March 4, 2008, 2:46pm UTC](https://www.ruby-forum.com/t/does-this-uri-parse-http-bug-has-been-fixed-in-ruby-1-9/130924 "2008-03-04T14:46:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![overclokkato](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/c67d28/32.png) [@overclokkato](https://www.ruby-forum.com/u/overclokkato)\
**Post date:** [March 4, 2008, 2:46pm UTC](https://www.ruby-forum.com/t/does-this-uri-parse-http-bug-has-been-fixed-in-ruby-1-9/130924/1 "2008-03-04T14:46:16Z")

</div>

Hello list,  
I’m looking for someone with a Ruby 1.9 installation for a quick test.

I just discovered a bug in URI.parse.  
This to run the following code:

> URI.parse(“http:/foo.bar.com”)

It returns an URI object but I would expect an error.

#\<URI::HTTP:0x2dc35a URL:http:/foo.bar.com\>

Someone can tell me if Ruby 1.9 addressed this bug?

Thanks,  
– Simone

---

<div class="post-metadata">

**Author:** ![overclokkato](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/c67d28/32.png) [@overclokkato](https://www.ruby-forum.com/u/overclokkato)\
**Post date:** [March 4, 2008, 3:39pm UTC](https://www.ruby-forum.com/t/does-this-uri-parse-http-bug-has-been-fixed-in-ruby-1-9/130924/2 "2008-03-04T15:39:40Z")

</div>

> > > > > “S” == Simone C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

S\> Someone can tell me if Ruby 1.9 addressed this bug?

vgs% ./ruby -ruri -ve ‘p URI.parse(“http:/foo.bar.com”)’  
ruby 1.9.0 (2008-03-04 revision 15686) [i686-linux]  
#\<URI::HTTP:0xb7c45d44 URL:http:/foo.bar.com\>  
vgs%

Guy Decoux

---

<div class="post-metadata">

**Author:** ![overclokkato](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/c67d28/32.png) [@overclokkato](https://www.ruby-forum.com/u/overclokkato)\
**Post date:** [March 5, 2008, 1:31am UTC](https://www.ruby-forum.com/t/does-this-uri-parse-http-bug-has-been-fixed-in-ruby-1-9/130924/3 "2008-03-05T01:31:02Z")

</div>

Hi,

At Tue, 4 Mar 2008 22:44:59 +0900,  
Simone C. wrote in [ruby-talk:293487]:

> I just discovered a bug in URI.parse.

It’s not a bug.

> This to run the following code:
> 
> > URI.parse(“http:/foo.bar.com”)
> 
> It returns an URI object but I would expect an error.

It is a valid URI which doesn’t have host part.

irb(main):001:0\> require ‘uri’  
=\> true  
irb(main):002:0\> uri = URI.parse(“http:/foo.bar.com”)  
=\> #\<URI::HTTP:0xb77f4038 URL:http:/foo.bar.com\>  
irb(main):003:0\> uri.path  
=\> “/foo.bar.com”  
irb(main):004:0\> uri.host  
=\> nil
