From: Eric Wong Date: Thu, 4 Aug 2022 08:16:57 +0000 (+0000) Subject: http: coerce SERVER_PORT to integer X-Git-Tag: v1.9.0~53 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=e28e9985f8b93ba5b0009f66be3b214f5fdea9b5;p=public-inbox.git http: coerce SERVER_PORT to integer This may save a few bytes with many connected clients. Noticed while working on the JMAP endpoint. --- diff --git a/lib/PublicInbox/HTTP.pm b/lib/PublicInbox/HTTP.pm index 669211e3..3d4e3499 100644 --- a/lib/PublicInbox/HTTP.pm +++ b/lib/PublicInbox/HTTP.pm @@ -135,7 +135,7 @@ sub app_dispatch { $env->{REMOTE_ADDR} = $self->{remote_addr}; $env->{REMOTE_PORT} = $self->{remote_port}; if (defined(my $host = $env->{HTTP_HOST})) { - $host =~ s/:([0-9]+)\z// and $env->{SERVER_PORT} = $1; + $host =~ s/:([0-9]+)\z// and $env->{SERVER_PORT} = $1 + 0; $env->{SERVER_NAME} = $host; } if (defined $input) {