]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/HTTP.pm
allow HTTP_HOST to be '0' via defined() checks
[public-inbox.git] / lib / PublicInbox / HTTP.pm
index a6ec1d0d7388540e2ace1a90ae16751f641297aa..071251c632e394302097538bf86ed881473a6fe5 100644 (file)
@@ -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;
        }