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://www.git.stargrave.org/?a=commitdiff_plain;h=fc17b626cf3b4425899ea5073621fbeb7f8be18c;p=public-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 10e6d6a4..977614b4 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) {