]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
http: fix 304 responses w/o entity body w/o reverse proxy
authorEric Wong <e@80x24.org>
Tue, 2 Jul 2024 23:27:03 +0000 (23:27 +0000)
committerEric Wong <e@80x24.org>
Wed, 3 Jul 2024 04:37:51 +0000 (04:37 +0000)
This was hidden by instances using varnish <and|or> nginx;
but is readily apparent when hitting static manifest.js.gz
when using `curl -z'

lib/PublicInbox/HTTP.pm

index bead222ec3fb5a159b34f6094ff4a01b090836d5..4ccb1b817c30d69ad8ce683935362a34ba831037 100644 (file)
@@ -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') {