From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 565BD1F63F for ; Sun, 29 Jan 2023 22:58:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1675033116; bh=PdprYj9e6QBICdGZIk2yTx0T1GW3ETsd5DuaiCNs4oI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=SuOKMEqUW22Gx1v5pQrTxS0v8fHXfYz60RRaadhjBNmdSE1EwGLVQh1lr07xMyi8q t/xIntnfdUKBtwLLE/0GI+ihl8PujWALcKIoT7jPj1KMb7bQ6UxvUn+ZGKTcDXPDw3 qZCMZmCh7i/A9tKnK2uqgA2Qbk2UUjlzFub3FNMw= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/2] lei_input: give a hint for upper-case in labels Date: Sun, 29 Jan 2023 22:58:34 +0000 Message-Id: <20230129225835.2830152-2-e@80x24.org> In-Reply-To: <20230129225835.2830152-1-e@80x24.org> References: <20230129225835.2830152-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: I just encountered this error in xt/lei-auth-fail.t --- lib/PublicInbox/LeiInput.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/PublicInbox/LeiInput.pm b/lib/PublicInbox/LeiInput.pm index c258f824..b6c2b6bb 100644 --- a/lib/PublicInbox/LeiInput.pm +++ b/lib/PublicInbox/LeiInput.pm @@ -30,6 +30,8 @@ my %ERR = ( my ($label) = @_; length($label) >= $L_MAX and return "`$label' too long (must be <= $L_MAX)"; + $label =~ /[A-Z]/ and + return "`$label' must be lowercase"; $label =~ m{\A[a-z0-9_](?:[a-z0-9_\-\./\@,]*[a-z0-9])?\z} ? undef : "`$label' is invalid"; },