From: Eric Wong Date: Tue, 4 Jun 2019 02:04:26 +0000 (+0000) Subject: http: require SERVER_PORT to be ASCII digit X-Git-Tag: v1.2.0~196^2~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc17b626cf3b4425899ea5073621fbeb7f8be18c;p=thirdparty%2Fpublic-inbox.git http: require SERVER_PORT to be ASCII digit I'm not sure what middlewares care for for SERVER_PORT; but allowing non-ASCII digits seems non-sensical, here. --- diff --git a/lib/PublicInbox/HTTP.pm b/lib/PublicInbox/HTTP.pm index 10e6d6a43..977614b48 100644 --- a/lib/PublicInbox/HTTP.pm +++ b/lib/PublicInbox/HTTP.pm @@ -142,7 +142,7 @@ sub app_dispatch { $env->{REMOTE_ADDR} = $self->{remote_addr}; $env->{REMOTE_PORT} = $self->{remote_port}; if (my $host = $env->{HTTP_HOST}) { - $host =~ s/:(\d+)\z// and $env->{SERVER_PORT} = $1; + $host =~ s/:([0-9]+)\z// and $env->{SERVER_PORT} = $1; $env->{SERVER_NAME} = $host; } if (defined $input) {