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

  • Thread starter Simone Carletti
  • Start date
S

Simone Carletti

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
 
N

Nobuyoshi Nakada

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:


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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top