Nobuyoshi Nakada
3/5/2008 12:30:00 AM
Hi,
At Tue, 4 Mar 2008 22:44:59 +0900,
Simone Carletti 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
--
Nobu Nakada