libwww-perl / URI

The Perl URI module
https://metacpan.org/pod/URI
Other
57 stars 48 forks source link

Leading Zeros in Port Numbers #69

Open gflohr opened 4 years ago

gflohr commented 4 years ago

Gratuitous leading zeros in port numbers should be stripped off. But the behavior of URI version 1.76 is:

$ perl -MURI -e "CORE::say URI->new('http://xyz:08080')->canonical->port"
08080

It already works as expected though for default ports:

$ perl -MURI -e "CORE::say URI->new('http://xyz:080')->canonical->port"
80
$ perl -MURI -e "CORE::say URI->new('https://xyz:0443')->canonical->port"
443