diff options
-rw-r--r-- | lib/PublicInbox/GitHTTPBackend.pm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/PublicInbox/GitHTTPBackend.pm b/lib/PublicInbox/GitHTTPBackend.pm index 61a13560..3aae5454 100644 --- a/lib/PublicInbox/GitHTTPBackend.pm +++ b/lib/PublicInbox/GitHTTPBackend.pm @@ -155,7 +155,11 @@ sub parse_cgi_headers { delete $ctx->{env}->{'qspawn.wcb'}; $ctx->{env}->{'plack.skip-deflater'} = 1; # prevent 2x gzip my $res = $ctx->{www}->coderepo->srv(\%ctx); - $res->(delete $ctx{env}->{'qspawn.wcb'}) if ref($res) eq 'CODE'; + if (ref($res) eq 'CODE') { + $res->(delete $ctx{env}->{'qspawn.wcb'}); + } else { # ref($res) eq 'ARRAY' + $ctx->{env}->{'qspawn.wcb'} = $ctx{env}->{'qspawn.wcb'}; + } $res; # non ARRAY ref for ->psgi_return_init_cb } else { [ $code, \@h ] |