From: Eric Wong Date: Wed, 5 Oct 2022 22:29:39 +0000 (+0000) Subject: www: do not call ->coderepo->srv on sub ref X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=9fe2348fc4a3462b2de0483b1a1f4baf6edff14c;p=public-inbox.git www: do not call ->coderepo->srv on sub ref The PublicInbox::Cgit wrapper will return a sub-ref for most responses, so ensure we don't try to treat it as an array-ref. --- diff --git a/lib/PublicInbox/WWW.pm b/lib/PublicInbox/WWW.pm index d0e20fb5..470510ae 100644 --- a/lib/PublicInbox/WWW.pm +++ b/lib/PublicInbox/WWW.pm @@ -197,8 +197,9 @@ sub news_cgit_fallback ($) { my $www = $ctx->{www}; my $env = $ctx->{env}; my $res = $www->news_www->call($env); - $res = $www->cgit->call($env) if $res->[0] == 404; - $res = $www->coderepo->srv($ctx) if $res->[0] == 404; + $res = $www->cgit->call($env, $ctx) if $res->[0] == 404; + ref($res) eq 'ARRAY' && $res->[0] == 404 and + $res = $www->coderepo->srv($ctx); $res; }