From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id AE5F41F9F7 for ; Tue, 4 Jun 2019 11:27:49 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 07/24] wwwlisting: require ASCII digit for port number Date: Tue, 4 Jun 2019 11:27:31 +0000 Message-Id: <20190604112748.23598-8-e@80x24.org> In-Reply-To: <20190604112748.23598-1-e@80x24.org> References: <20190604112748.23598-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: We only care about the hostname portion for matching, so this change is probably inconsequential. --- lib/PublicInbox/WwwListing.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/WwwListing.pm b/lib/PublicInbox/WwwListing.pm index e8dad4b..e1473b3 100644 --- a/lib/PublicInbox/WwwListing.pm +++ b/lib/PublicInbox/WwwListing.pm @@ -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; -- EW