]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
examples/repobrowse.psgi: disable Chunked response by default
authorEric Wong <e@80x24.org>
Sat, 12 Mar 2016 03:41:12 +0000 (03:41 +0000)
committerEric Wong <e@80x24.org>
Tue, 5 Apr 2016 18:58:27 +0000 (18:58 +0000)
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
t/repobrowse_common_git.perl

index be4c1d2b9106fc75ea211afa257cf7e45dea1495..faf8c331bd50fd82a1bec381cf44ced27d4bc74e 100644 (file)
@@ -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',
index 9c62a2614ce31c7bd3306abf9f13ca30a9a43bc7..cd8ce582ef044dc4d76fef813916a7f6bd389c85 100644 (file)
@@ -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;