From 78951743029a1d0074ff447c612b2750a83623e5 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 12 Mar 2016 03:41:12 +0000 Subject: examples/repobrowse.psgi: disable Chunked response by default It seems incompatible with Starman and probably confuses other HTTP/1.0-only servers, too. Our -httpd will respect it and requires it for persistent connections. Followup-to: dca2724e0aeb ("examples: disable Chunked response in PSGI example") --- examples/repobrowse.psgi | 4 +++- t/repobrowse_common_git.perl | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/repobrowse.psgi b/examples/repobrowse.psgi index be4c1d2b..faf8c331 100644 --- a/examples/repobrowse.psgi +++ b/examples/repobrowse.psgi @@ -15,7 +15,9 @@ use Plack::Builder; my $repobrowse = PublicInbox::Repobrowse->new; builder { - enable 'Chunked'; + # Chunked middleware conflicts with Starman: + # https://github.com/miyagawa/Starman/issues/23 + # enable 'Chunked'; eval { enable 'Deflater', content_type => [ 'text/html', 'text/plain', diff --git a/t/repobrowse_common_git.perl b/t/repobrowse_common_git.perl index 9c62a261..cd8ce582 100644 --- a/t/repobrowse_common_git.perl +++ b/t/repobrowse_common_git.perl @@ -15,7 +15,7 @@ foreach my $mod (@mods) { sub dechunk ($) { my ($res) = @_; my $s = $res->content; - if (lc($res->header('Transfer-Encoding')) eq 'chunked') { + if (lc($res->header('Transfer-Encoding') || '') eq 'chunked') { my $rv = ''; while ($s =~ s/\A([a-f0-9]+)\r\n//i) { # no comment support :x my $n = hex($1) or last; -- cgit v1.2.3-24-ge0c7