diff --git a/spring-web/src/main/java/org/springframework/http/codec/multipart/MultipartHttpMessageWriter.java b/spring-web/src/main/java/org/springframework/http/codec/multipart/MultipartHttpMessageWriter.java index 80f21cfa8b..5730132cf1 100644 --- a/spring-web/src/main/java/org/springframework/http/codec/multipart/MultipartHttpMessageWriter.java +++ b/spring-web/src/main/java/org/springframework/http/codec/multipart/MultipartHttpMessageWriter.java @@ -202,8 +202,8 @@ public class MultipartHttpMessageWriter extends LoggingCodecSupport if (contentType != null) { return MediaType.MULTIPART_FORM_DATA.includes(contentType); } - for (String name : map.keySet()) { - for (Object value : map.get(name)) { + for (List values : map.values()) { + for (Object value : values) { if (value != null && !(value instanceof String)) { return true; } diff --git a/spring-web/src/main/java/org/springframework/http/converter/FormHttpMessageConverter.java b/spring-web/src/main/java/org/springframework/http/converter/FormHttpMessageConverter.java index 9656be51b3..fda03fd017 100644 --- a/spring-web/src/main/java/org/springframework/http/converter/FormHttpMessageConverter.java +++ b/spring-web/src/main/java/org/springframework/http/converter/FormHttpMessageConverter.java @@ -283,8 +283,8 @@ public class FormHttpMessageConverter implements HttpMessageConverter values : map.values()) { + for (Object value : values) { if (value != null && !(value instanceof String)) { return true; }