Browse Source

Use Map.values() iteration within isMultipart check

Closes gh-22982
pull/23837/head
Juergen Hoeller 6 years ago
parent
commit
4c334de850
  1. 4
      spring-web/src/main/java/org/springframework/http/codec/multipart/MultipartHttpMessageWriter.java
  2. 4
      spring-web/src/main/java/org/springframework/http/converter/FormHttpMessageConverter.java

4
spring-web/src/main/java/org/springframework/http/codec/multipart/MultipartHttpMessageWriter.java

@ -202,8 +202,8 @@ public class MultipartHttpMessageWriter extends LoggingCodecSupport @@ -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;
}

4
spring-web/src/main/java/org/springframework/http/converter/FormHttpMessageConverter.java

@ -283,8 +283,8 @@ public class FormHttpMessageConverter implements HttpMessageConverter<MultiValue @@ -283,8 +283,8 @@ public class FormHttpMessageConverter implements HttpMessageConverter<MultiValue
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;
}

Loading…
Cancel
Save