Skip Menu |

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

Report information
The Basics
Id: 92562
Status: resolved
Priority: 0/
Queue: Regexp-Common

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

Bug Information
Severity: Normal
Broken in:
  • 2010010201
  • 2011041601
  • 2011041602
  • 2011041701
  • 2011121001
  • 2013030901
  • 2013031101
  • 2013031201
  • 2013031301
Fixed in: (no value)



Subject: $RE{URI}{HTTP} doesn't match https:// URLs.
HTTP over SSL URLs are not currently matched, despite the code being there to match; it looks like a typo in Regexp/Common/URI/http.pm (patch attached). Tests to reproduce: perl -e 'use Regexp::Common qw(URI); print "$RE{URI}{HTTP}\n"; if ("https://somesite.com/" =~ m/$RE{URI}{HTTP}/) { print "Success!\n" } else { print "Ba-bow\n" }' (?:(?:http)://(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0-9]*[a-zA-Z0-9]|[a-zA-Z])[.]?)|(?:[0-9]+[.][0-9]+[.][0-9]+[.][0-9]+)))(?::(?:(?:[0-9]*)))?(?:/(?:(?:(?:(?:(?:(?:[a-zA-Z0-9\-_.!~*'():@&=+$,]+|(?:%[a-fA-F0-9][a-fA-F0-9]))*)(?:;(?:(?:[a-zA-Z0-9\-_.!~*'():@&=+$,]+|(?:%[a-fA-F0-9][a-fA-F0-9]))*))*)(?:/(?:(?:(?:[a-zA-Z0-9\-_.!~*'():@&=+$,]+|(?:%[a-fA-F0-9][a-fA-F0-9]))*)(?:;(?:(?:[a-zA-Z0-9\-_.!~*'():@&=+$,]+|(?:%[a-fA-F0-9][a-fA-F0-9]))*))*))*))(?:[?](?:(?:(?:[;/?:@&=+$,a-zA-Z0-9\-_.!~*'()]+|(?:%[a-fA-F0-9][a-fA-F0-9]))*)))?))?) Ba-bow After patching: perl -e 'use Regexp::Common qw(URI); print "$RE{URI}{HTTP}\n"; if ("https://somesite.com/" =~ m/$RE{URI}{HTTP}/) { print "Success!\n" } else { print "Ba-bow\n" }' (?:(?:https?)://(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0-9]*[a-zA-Z0-9]|[a-zA-Z])[.]?)|(?:[0-9]+[.][0-9]+[.][0-9]+[.][0-9]+)))(?::(?:(?:[0-9]*)))?(?:/(?:(?:(?:(?:(?:(?:[a-zA-Z0-9\-_.!~*'():@&=+$,]+|(?:%[a-fA-F0-9][a-fA-F0-9]))*)(?:;(?:(?:[a-zA-Z0-9\-_.!~*'():@&=+$,]+|(?:%[a-fA-F0-9][a-fA-F0-9]))*))*)(?:/(?:(?:(?:[a-zA-Z0-9\-_.!~*'():@&=+$,]+|(?:%[a-fA-F0-9][a-fA-F0-9]))*)(?:;(?:(?:[a-zA-Z0-9\-_.!~*'():@&=+$,]+|(?:%[a-fA-F0-9][a-fA-F0-9]))*))*))*))(?:[?](?:(?:(?:[;/?:@&=+$,a-zA-Z0-9\-_.!~*'()]+|(?:%[a-fA-F0-9][a-fA-F0-9]))*)))?))?) Success!
Subject: Regexp-Common-URI-HTTP.patch
--- URI/http.pm.orig 2014-01-29 16:39:02.409221757 +0000 +++ URI/http.pm 2014-01-29 16:39:18.111518424 +0000 @@ -21,7 +21,7 @@ pattern name => [qw (URI HTTP), "-scheme=http"], create => sub { my $scheme = $_ [1] -> {-scheme}; - my $uri = $http_uri; + my $uri = $https_uri; $uri =~ s/http/$scheme/; $uri; }
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #92562] $RE{URI}{HTTP} doesn't match https:// URLs.
Date: Wed, 29 Jan 2014 18:06:13 +0100
To: Brad Macpherson via RT <bug-Regexp-Common [...] rt.cpan.org>
From: Abigail <abigail [...] abigail.be>
On Wed, Jan 29, 2014 at 11:50:12AM -0500, Brad Macpherson via RT wrote: Show quoted text
> Wed Jan 29 11:50:11 2014: Request 92562 was acted upon. > Transaction: Ticket created by BRAD > Queue: Regexp-Common > Subject: $RE{URI}{HTTP} doesn't match https:// URLs. > Broken in: 2010010201, 2011041601, 2011041602, 2011041701, 2011121001, 2013030901, 2013031101, 2013031201, 2013031301 > Severity: Normal > Owner: Nobody > Requestors: BRAD@cpan.org > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=92562 > > > > HTTP over SSL URLs are not currently matched, despite the code being there to match; it looks like a typo in Regexp/Common/URI/http.pm (patch attached).
It is not. The current behaviour is intended. To get https URLs, use: $RE {URI} {HTTP} {-scheme => 'https'} To get a pattern that matches both http and https schemes, use $RE {URI} {HTTP} {-scheme => 'https?'} Abigail
Subject: Re: [rt.cpan.org #92562] $RE{URI}{HTTP} doesn't match https:// URLs.
Date: Wed, 29 Jan 2014 19:59:36 +0000
To: "bug-Regexp-Common [...] rt.cpan.org" <bug-Regexp-Common [...] rt.cpan.org>
From: Brad Macpherson <brad [...] teched-creations.com>
Aha - I missed that in the documentation (only dug as far as Regexp::Common::URI before giving up and looking at the returned regex etc). Cheers Brad Show quoted text
> On 29 Jan 2014, at 18:53, "Abigail via RT" <bug-Regexp-Common@rt.cpan.org> wrote: > > <URL: https://rt.cpan.org/Ticket/Display.html?id=92562 > >
>> On Wed, Jan 29, 2014 at 11:50:12AM -0500, Brad Macpherson via RT wrote: >> Wed Jan 29 11:50:11 2014: Request 92562 was acted upon. >> Transaction: Ticket created by BRAD >> Queue: Regexp-Common >> Subject: $RE{URI}{HTTP} doesn't match https:// URLs. >> Broken in: 2010010201, 2011041601, 2011041602, 2011041701, 2011121001, 2013030901, 2013031101, 2013031201, 2013031301 >> Severity: Normal >> Owner: Nobody >> Requestors: BRAD@cpan.org >> Status: new >> Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=92562 > >> >> >> HTTP over SSL URLs are not currently matched, despite the code being there to match; it looks like a typo in Regexp/Common/URI/http.pm (patch attached).
> > It is not. The current behaviour is intended. To get https URLs, use: > > $RE {URI} {HTTP} {-scheme => 'https'} > > To get a pattern that matches both http and https schemes, use > > $RE {URI} {HTTP} {-scheme => 'https?'} > > > Abigail >
RT-Send-CC: brad [...] teched-creations.com
On Wed Jan 29 11:50:11 2014, BRAD wrote: Show quoted text
> HTTP over SSL URLs are not currently matched, despite the code being > there to match; it looks like a typo in Regexp/Common/URI/http.pm > (patch attached). > > Tests to reproduce: > > perl -e 'use Regexp::Common qw(URI); print "$RE{URI}{HTTP}\n"; if > ("https://somesite.com/" =~ m/$RE{URI}{HTTP}/) { print "Success!\n" } > else { print "Ba-bow\n" }' > (?:(?:http)://(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0- > 9])[.])*(?:[a-zA-Z][-a-zA-Z0-9]*[a-zA-Z0-9]|[a-zA-Z])[.]?)|(?:[0- > 9]+[.][0-9]+[.][0-9]+[.][0-9]+)))(?::(?:(?:[0- > 9]*)))?(?:/(?:(?:(?:(?:(?:(?:[a-zA-Z0-9\-_.!~*'():@&=+$,]+|(?:%[a-fA- > F0-9][a-fA-F0-9]))*)(?:;(?:(?:[a-zA-Z0-9\-_.!~*'():@&=+$,]+|(?:%[a-fA- > F0-9][a-fA-F0-9]))*))*)(?:/(?:(?:(?:[a-zA-Z0-9\- > _.!~*'():@&=+$,]+|(?:%[a-fA-F0-9][a-fA-F0-9]))*)(?:;(?:(?:[a-zA-Z0-9\- > _.!~*'():@&=+$,]+|(?:%[a-fA-F0-9][a-fA-F0- > 9]))*))*))*))(?:[?](?:(?:(?:[;/?:@&=+$,a-zA-Z0-9\-_.!~*'()]+|(?:%[a- > fA-F0-9][a-fA-F0-9]))*)))?))?) > Ba-bow > > After patching: > > perl -e 'use Regexp::Common qw(URI); print "$RE{URI}{HTTP}\n"; if > ("https://somesite.com/" =~ m/$RE{URI}{HTTP}/) { print "Success!\n" } > else { print "Ba-bow\n" }' > (?:(?:https?)://(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0- > 9])[.])*(?:[a-zA-Z][-a-zA-Z0-9]*[a-zA-Z0-9]|[a-zA-Z])[.]?)|(?:[0- > 9]+[.][0-9]+[.][0-9]+[.][0-9]+)))(?::(?:(?:[0- > 9]*)))?(?:/(?:(?:(?:(?:(?:(?:[a-zA-Z0-9\-_.!~*'():@&=+$,]+|(?:%[a-fA- > F0-9][a-fA-F0-9]))*)(?:;(?:(?:[a-zA-Z0-9\-_.!~*'():@&=+$,]+|(?:%[a-fA- > F0-9][a-fA-F0-9]))*))*)(?:/(?:(?:(?:[a-zA-Z0-9\- > _.!~*'():@&=+$,]+|(?:%[a-fA-F0-9][a-fA-F0-9]))*)(?:;(?:(?:[a-zA-Z0-9\- > _.!~*'():@&=+$,]+|(?:%[a-fA-F0-9][a-fA-F0- > 9]))*))*))*))(?:[?](?:(?:(?:[;/?:@&=+$,a-zA-Z0-9\-_.!~*'()]+|(?:%[a- > fA-F0-9][a-fA-F0-9]))*)))?))?) > Success!
Brad, if you're satisfied, can you close this ticket? I'm going through the queue trying to clear as much stuff as I can without the maintainer needing to be involved since it just takes time if they need to deal with it. Thanks, Robert
Closing as PEBKAC.