Skip Menu |

This queue is for tickets about the URI CPAN distribution.

Report information
The Basics
Id: 53252
Status: rejected
Priority: 0/
Queue: URI

Owner: Nobody in particular
Requestors: jean [...]

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)

Subject: Missing // in canonical
When the scheme is set using the 'scheme' method, the 'canonical' method seems to skip the double slash :

Example :

    my $uri = URI->new('');
    print $uri->canonical, "\n";

This prints

instead of

This looks like a bug, unless I misundestood the use of 'scheme', or something else.
Many thanks.
This isn't a bug. URI->new('') creates a relative URL.  The string '' is treated as a path name -- not a host name even if it looks like one.  Addding a scheme to a relative URL gives the result you saw.

You can use the URI::Heuristic if you want to convert strings like '' to URLs.

From: jean [...]
Download (untitled) / with headers
text/plain 105b
Oh, I&nbsp;see ! That was tricky.<br /> <br /> Many thanks your the prompt response !<br /> <br /> <br />

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to