Skip Menu |

This queue is for tickets about the URI CPAN distribution.

Report information
The Basics
Id: 41292
Status: new
Priority: 0/
Queue: URI

Owner: Nobody in particular
Requestors: wdhawes [...] (daily)

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

Subject: Stringified URI::URL does not include port number
Download (untitled) / with headers
text/plain 695b
If you call URI::URL->new() using a URL with a standard port number for the protocol in question (e.g. '' or 'rtsp://'), the port number is returned by ->port(), but is omitted when the object is stringified: my $uri = URI::URL->new(''); print $uri->port; # 80 print $uri; # '' If you then explicitly set the port to the same value, it does get included: $uri->port(80); print $uri->port; # 80 print $uri; # '' The issue is not present when using a non-standard port in the URL passed to the constructor: print URI::URL->new(''); # '' A failing test is attached.
text/x-perl 433b
#!perl use strict; use warnings; use Test::More tests => 3; use URI::URL; my $str = 'rtsp://'; my $uri = URI::URL->new($str); is($uri->port, 554, 'URL::URL has correct port number'); like($uri, qr/:554/, 'stringified URI::URL includes port number'); # explicitly setting the same port number makes the test pass $uri->port(554); like($uri, qr/:554/, 'stringified URI::URL includes port number');

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

Please report any issues with to