]> Sergey Matveev's repositories - public-inbox.git/commitdiff
wwwlisting: require ASCII digit for port number
authorEric Wong <e@80x24.org>
Tue, 4 Jun 2019 08:32:27 +0000 (08:32 +0000)
committerEric Wong <e@80x24.org>
Tue, 4 Jun 2019 10:06:18 +0000 (10:06 +0000)
We only care about the hostname portion for matching,
so this change is probably inconsequential.

lib/PublicInbox/WwwListing.pm

index e8dad4b892f50aceac866ef0956338edbb569ab0..e1473b3deec7135b4aa9557a65371ce9dd469d7a 100644 (file)
@@ -24,8 +24,8 @@ sub list_match_domain ($$) {
        my ($self, $env) = @_;
        my @list;
        my $host = $env->{HTTP_HOST} // $env->{SERVER_NAME};
-       $host =~ s/:\d+\z//;
-       my $re = qr!\A(?:https?:)?//\Q$host\E(?::\d+)?/!i;
+       $host =~ s/:[0-9]+\z//;
+       my $re = qr!\A(?:https?:)?//\Q$host\E(?::[0-9]+)?/!i;
        $self->{pi_config}->each_inbox(sub {
                my ($ibx) = @_;
                push @list, $ibx if !$ibx->{-hide}->{www} && $ibx->{url} =~ $re;