]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei_input: give a hint for upper-case in labels
authorEric Wong <e@80x24.org>
Sun, 29 Jan 2023 22:58:34 +0000 (22:58 +0000)
committerEric Wong <e@80x24.org>
Mon, 30 Jan 2023 06:42:39 +0000 (06:42 +0000)
I just encountered this error in xt/lei-auth-fail.t

lib/PublicInbox/LeiInput.pm

index c258f824e8325101c80e55362ea6368b27434358..b6c2b6bbe8b77b30af2e273be04a548049a15937 100644 (file)
@@ -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";
        },