about summary refs log tree commit homepage
path: root/lib/PublicInbox/HTTP.pm
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-01-10 09:14:16 +0000
committerEric Wong <e@yhbt.net>2020-01-11 06:32:08 +0000
commit8f4720a57d9c5746dcf53fa6c612350c744c2cd1 (patch)
treeee36b17d0a3431ec2fd122bb9a3ff438e67f96f3 /lib/PublicInbox/HTTP.pm
parentcb1c874520153f5c28a932959446977062c7db69 (diff)
downloadpublic-inbox-8f4720a57d9c5746dcf53fa6c612350c744c2cd1.tar.gz
'0' is a valid value for HTTP_HOST, and maybe some folks
will want to hit that as port 80 where the HTTP client won't
send the ":$PORT" suffix.
Diffstat (limited to 'lib/PublicInbox/HTTP.pm')
-rw-r--r--lib/PublicInbox/HTTP.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/PublicInbox/HTTP.pm b/lib/PublicInbox/HTTP.pm
index a6ec1d0d..071251c6 100644
--- a/lib/PublicInbox/HTTP.pm
+++ b/lib/PublicInbox/HTTP.pm
@@ -155,7 +155,7 @@ sub app_dispatch {
         my $env = $self->{env};
         $env->{REMOTE_ADDR} = $self->{remote_addr};
         $env->{REMOTE_PORT} = $self->{remote_port};
-        if (my $host = $env->{HTTP_HOST}) {
+        if (defined(my $host = $env->{HTTP_HOST})) {
                 $host =~ s/:([0-9]+)\z// and $env->{SERVER_PORT} = $1;
                 $env->{SERVER_NAME} = $host;
         }