From 9f73b58f78fdaa484241547c96d344bdf29fc7cb Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 29 Jan 2023 22:58:34 +0000 Subject: lei_input: give a hint for upper-case in labels 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"; }, -- cgit v1.2.3-24-ge0c7