sub psgi_triple {
my ($ctx) = @_;
- my $h = [ 'Content-Type', 'text/html; charset=UTF-8',
- 'Content-Length', undef ];
+ my $h = [ 'Content-Type', 'text/html; charset=UTF-8' ];
my $gzf = gzf_maybe($h, $ctx->{env});
my $zfh = $gzf->zfh;
print $zfh '<html><head><title>public-inbox listing</title>',
qq(This is a listing of public inboxes, see the `mirror' link of each inbox
for instructions on how to mirror all the data and code on this site.) .
'</pre></body></html>');
- $h->[3] = length($out);
+ push @$h, 'Content-Length', length($out);
[ $code, $h, [ $out ] ];
}
sub html_oneshot ($$;@) {
my ($ctx, $code) = @_[0, 1];
- my $res_hdr = [ 'Content-Type' => 'text/html; charset=UTF-8',
- 'Content-Length' => undef ];
+ my $res_hdr = [ 'Content-Type' => 'text/html; charset=UTF-8' ];
bless $ctx, __PACKAGE__;
$ctx->{gz} = PublicInbox::GzipFilter::gz_or_noop($res_hdr, $ctx->{env});
my @top;
$ctx->{base_url} = base_url($ctx);
};
my $bdy = $ctx->zflush(@top, @_[2..$#_], _html_end($ctx));
- $res_hdr->[3] = length($bdy);
+ push @$res_hdr, 'Content-Length', length($bdy);
[ $code, $res_hdr, [ $bdy ] ]
}