Skip Menu |

This queue is for tickets about the Regexp-Common CPAN distribution.

Report information
The Basics
Id: 68880
Status: rejected
Priority: 0/
Queue: Regexp-Common

People
Owner: Nobody in particular
Requestors: rt.cpan [...] sartak.org
Cc:
AdminCc:

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



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"; }
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #68880] URI::http doesn't match http://0:8888/
Date: Fri, 17 Jun 2011 00:21:58 +0200
To: Shawn M Moore via RT <bug-Regexp-Common [...] rt.cpan.org>
From: Abigail <abigail [...] abigail.be>
On Thu, Jun 16, 2011 at 04:36:41PM -0400, Shawn M Moore via RT wrote: Show quoted text
> Thu Jun 16 16:36:41 2011: Request 68880 was acted upon. > Transaction: Ticket created by SARTAK > Queue: Regexp-Common > Subject: URI::http doesn't match http://0:8888/ > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: sartak@gmail.com > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=68880 > > > > 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/
That may be, but the RFC does *not* say that the first part what follows http:// can be anything that one tool or another interprets as an IP address. In fact, the RFC says that it's either a hostname, or *four* decimal numbers separated by dots. 0 isn't either of them. Hence, 'http://0/index.html' isn't a valid URI, although there will be tools out there that are liberal in what they accept, and make up for the mistakes of the user. But the patterns are *validating* patterns, and hence, are conservative in what they accept. Regards, Abigail
Subject: Re: [rt.cpan.org #68880] URI::http doesn't match http://0:8888/
Date: Fri, 17 Jun 2011 14:40:24 -0400
To: "bug-Regexp-Common [...] rt.cpan.org" <bug-Regexp-Common [...] rt.cpan.org>
From: Sartak <sartak [...] gmail.com>
2011年6月16日木曜日 Abigail via RT bug-Regexp-Common@rt.cpan.org: Show quoted text
> Hence, 'http://0/index.html' isn't a valid URI, although there will be > tools out there that are liberal in what they accept, and make up for the > mistakes of the user. > > > But the patterns are *validating* patterns, and hence, are conservative > in what they accept.
This is a perfectly defensible position to take. I'll see about improving the tools that generate such questionable vaguely-URI-like strings. :) Cheers! Shawn