From de63c96653775cb0360e6270cfa151f88ef31adb Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 2 Jul 2024 23:27:03 +0000 Subject: [PATCH] http: fix 304 responses w/o entity body w/o reverse proxy This was hidden by instances using varnish nginx; but is readily apparent when hitting static manifest.js.gz when using `curl -z' --- lib/PublicInbox/HTTP.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/HTTP.pm b/lib/PublicInbox/HTTP.pm index bead222ec..4ccb1b817 100644 --- a/lib/PublicInbox/HTTP.pm +++ b/lib/PublicInbox/HTTP.pm @@ -189,7 +189,8 @@ sub response_header_write ($$$) { } my $conn = $env->{HTTP_CONNECTION} || ''; - my $term = defined($len) || $chunked; + my $term = defined($len) || $chunked || + Plack::Util::status_with_no_entity_body($status); my $prot_persist = ($proto eq 'HTTP/1.1') && ($conn !~ /\bclose\b/i); my ($alive, $res_body); if (!$term && ref($res->[2]) eq 'ARRAY') { -- 2.47.2