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.
---
lib/PublicInbox/HTTP.pm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/PublicInbox/HTTP.pm b/lib/PublicInbox/HTTP.pm
index a5c56e2..68c3b78 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";
--
EW
--
unsubscribe: [email protected]
archive: http://public-inbox.org/meta/