forked from mtusi2026/mtusi2026lab2
fix problems
This commit is contained in:
@@ -35,7 +35,9 @@ final class Input {
|
||||
if (node == null || !node.isTextual()) throw ApiException.invalid("Пароль должен быть строкой");
|
||||
String value = node.textValue();
|
||||
int length = value.codePointCount(0, value.length());
|
||||
if (length < 12 || length > 128) throw ApiException.invalid("Пароль должен содержать от 12 до 128 символов");
|
||||
if (length < 12 || length > 128 || value.codePoints().allMatch(Input::isUnicodeWhitespace)) {
|
||||
throw ApiException.invalid("Пароль должен содержать от 12 до 128 непробельных символов");
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user