perf: 限制 PagingAndSortingQueryParams 中用于排序的字段名称的长度,允许包含短横(-)。

This commit is contained in:
zhouxy108 2025-04-03 09:01:11 +08:00
parent 615837ac27
commit d34634a18b

View File

@ -50,7 +50,7 @@ public class PagingAndSortingQueryParams {
private Long pageNum;
private List<String> orderBy;
private static final Pattern SORT_STR_PATTERN = Pattern.compile("^[a-zA-Z]\\w+-(desc|asc|DESC|ASC)$");
private static final Pattern SORT_STR_PATTERN = Pattern.compile("^[a-zA-Z][\\w-]{0,63}-(desc|asc|DESC|ASC)$");
private final Map<String, String> sortableProperties;