Subject: | URI::http doesn't match http://0:8888/ |
plackup in particular seems to generate URLs with http://0/ in them.
Recall that an IP address can be addressed as a single integer, and so 0
is a short way to specify http://0.0.0.0/
use Regexp::Common qw(URI);
my @urls = qw(
http://0/index.html
http://1/index.html
http://0.0.0.0/index.html
http://localhost/index.html
http://0:8888/index.html
http://1:8888/index.html
http://0.0.0.0:8888/index.html
http://localhost:8888/index.html
);
for my $url (@urls) {
print "$url: " . ("x $url x" =~ /$RE{URI}{HTTP}/ ? "match" : "NO
MATCH") . "\n";
}