From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 607B21F4DA for ; Wed, 5 Oct 2022 22:29:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1665008981; bh=5utJq55mc1DMkWBlMkz5lWBKPoaadyVZpl67plReYHI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=UYPAyemEBc682obK8RZyz97EUgKS1BwF6xTYvZWICWCFbU1a5WQ9/jIfPL+IAWykV RQ6+qXNgxIM4Js2MkzW22p6SL37qBm/unCgN4dnEYqQLDQkkm7yGJtSEDyVV6vVruG 1TCOKxz6Eao/CzSGitVBmkJjJrupkCCjGZqyL9F0= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/3] www: do not call ->coderepo->srv on sub ref Date: Wed, 5 Oct 2022 22:29:39 +0000 Message-Id: <20221005222941.4098-2-e@80x24.org> In-Reply-To: <20221005222941.4098-1-e@80x24.org> References: <20221005222941.4098-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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. --- lib/PublicInbox/WWW.pm | 5 +++-- 1 file 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; }