From: Eric Wong Date: Sun, 29 Jan 2023 22:58:34 +0000 (+0000) Subject: lei_input: give a hint for upper-case in labels X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=9f73b58f78fdaa484241547c96d344bdf29fc7cb;hp=859cafe15f4c6055f7944ae4ad2d0560c8249755;p=public-inbox.git lei_input: give a hint for upper-case in labels I just encountered this error in xt/lei-auth-fail.t --- 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"; },