about summary refs log tree commit homepage
path: root/lib/PublicInbox/WWW.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-10-05 22:29:39 +0000
committerEric Wong <e@80x24.org>2022-10-07 07:27:24 +0000
commit9fe2348fc4a3462b2de0483b1a1f4baf6edff14c (patch)
treecf817f9c1e1e1d1a3753881866ecdbdad67b34f6 /lib/PublicInbox/WWW.pm
parentffea66b1a6c5c9d501c42aa7605cf81d49d3c9b1 (diff)
downloadpublic-inbox-9fe2348fc4a3462b2de0483b1a1f4baf6edff14c.tar.gz
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.
Diffstat (limited to 'lib/PublicInbox/WWW.pm')
-rw-r--r--lib/PublicInbox/WWW.pm5
1 files changed, 3 insertions, 2 deletions
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;
 }