about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-03-12 03:41:12 +0000
committerEric Wong <e@80x24.org>2016-04-05 18:58:27 +0000
commit78951743029a1d0074ff447c612b2750a83623e5 (patch)
treedfa1ec0df93302d9c2ec52fcbf64deba7db8cdde
parent5f23d7e860773bfc585eb45cff028cee5b652d51 (diff)
downloadpublic-inbox-78951743029a1d0074ff447c612b2750a83623e5.tar.gz
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")
-rw-r--r--examples/repobrowse.psgi4
-rw-r--r--t/repobrowse_common_git.perl2
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;