From 7b95bd72f7e9922f655c582f47c2fe80d8664a1b Mon Sep 17 00:00:00 2001 From: Johnny Lim Date: Wed, 6 Dec 2023 21:41:16 +0900 Subject: [PATCH] Fix condition for "Too many elements" in MimeTypeUtils.sortBySpecificity() See gh-31254 Closes gh-31769 --- .../src/main/java/org/springframework/util/MimeTypeUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-core/src/main/java/org/springframework/util/MimeTypeUtils.java b/spring-core/src/main/java/org/springframework/util/MimeTypeUtils.java index fb23809994dd..54e5fd00293b 100644 --- a/spring-core/src/main/java/org/springframework/util/MimeTypeUtils.java +++ b/spring-core/src/main/java/org/springframework/util/MimeTypeUtils.java @@ -362,7 +362,7 @@ public static String toString(Collection mimeTypes) { */ public static void sortBySpecificity(List mimeTypes) { Assert.notNull(mimeTypes, "'mimeTypes' must not be null"); - if (mimeTypes.size() >= 50) { + if (mimeTypes.size() > 50) { throw new InvalidMimeTypeException(mimeTypes.toString(), "Too many elements"); }