about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-04-04 21:15:26 +0000
committerEric Wong <e@80x24.org>2016-04-04 21:15:45 +0000
commita7b196b4e6b27ee10f126a36702a63a5ae787df1 (patch)
treee318224cedb0a9b6564a10127b0783b09dec3474 /lib
parent49978fa6086ad23927805d24d9adb70b96ec337a (diff)
downloadpublic-inbox-a7b196b4e6b27ee10f126a36702a63a5ae787df1.tar.gz
Oops, we need to watch out for how we handle operator
precedence and ensure responses without a Content-Length
or "Transfer-Encoding: chunked" header will always
disconnect after writing.
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/HTTP.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/PublicInbox/HTTP.pm b/lib/PublicInbox/HTTP.pm
index a5c56e25..68c3b788 100644
--- a/lib/PublicInbox/HTTP.pm
+++ b/lib/PublicInbox/HTTP.pm
@@ -169,8 +169,8 @@ sub response_header_write {
 
         my $conn = $env->{HTTP_CONNECTION} || '';
         my $alive = (defined($len) || $chunked) &&
-                        ($proto eq 'HTTP/1.1' && $conn !~ /\bclose\b/i) ||
-                        ($conn =~ /\bkeep-alive\b/i);
+                        (($proto eq 'HTTP/1.1' && $conn !~ /\bclose\b/i) ||
+                         ($conn =~ /\bkeep-alive\b/i));
 
         $h .= 'Connection: ' . ($alive ? 'keep-alive' : 'close');
         $h .= "\r\nDate: " . http_date() . "\r\n\r\n";