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, T_SCC_BODY_TEXT_LINE 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 E6D651F61A for ; Mon, 22 Aug 2022 02:33:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1661135626; bh=TBMIifv9fFbQVEe7B7peuUTSNX9yeLxJ+9tPfm16nDI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=CQ/8dw1r3n0c7ok7gsR6TAb2gO6A7MvapZUOWgKCfZO9jNgobgP/izA8RVCV9fl2P u32Pt/hbFk1PjlBpciawv+e/fMoC8mP2RilJlU8hAQXQjYyjHxXo/7t17FkleGy1g6 9v9juNAZuOlRuOCoMfbmtMByRdHeUYN1Attwz12Q= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 3/7] www: /s/: 404 for unconfigured coderepos Date: Mon, 22 Aug 2022 02:33:42 +0000 Message-Id: <20220822023346.938859-4-e@80x24.org> In-Reply-To: <20220822023346.938859-1-e@80x24.org> References: <20220822023346.938859-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: The $r404 variable is unset if we have a valid inbox, but no coderepos configured for that inbox, thus we must `r(404)' explicitly. --- lib/PublicInbox/WWW.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/WWW.pm b/lib/PublicInbox/WWW.pm index a33709e9..77f463d3 100644 --- a/lib/PublicInbox/WWW.pm +++ b/lib/PublicInbox/WWW.pm @@ -303,7 +303,8 @@ sub get_text { sub get_vcs_object ($$$;$) { my ($ctx, $inbox, $oid, $filename) = @_; my $r404 = invalid_inbox($ctx, $inbox); - return $r404 if $r404 || !$ctx->{www}->{pi_cfg}->repo_objs($ctx->{ibx}); + return $r404 if $r404; + return r(404) if !$ctx->{www}->{pi_cfg}->repo_objs($ctx->{ibx}); require PublicInbox::ViewVCS; PublicInbox::ViewVCS::show($ctx, $oid, $filename); }