diff --git a/spring-web/src/main/java/org/springframework/http/codec/FormHttpMessageReader.java b/spring-web/src/main/java/org/springframework/http/codec/FormHttpMessageReader.java index e3626d0991..ff58e9e5af 100644 --- a/spring-web/src/main/java/org/springframework/http/codec/FormHttpMessageReader.java +++ b/spring-web/src/main/java/org/springframework/http/codec/FormHttpMessageReader.java @@ -77,8 +77,9 @@ public class FormHttpMessageReader implements HttpMessageReader()), + MediaType.APPLICATION_FORM_URLENCODED)); + assertFalse(this.reader.canRead( ResolvableType.forClassWithGenerics(MultiValueMap.class, String.class, Object.class), MediaType.APPLICATION_FORM_URLENCODED)); diff --git a/spring-web/src/test/java/org/springframework/http/codec/FormHttpMessageWriterTests.java b/spring-web/src/test/java/org/springframework/http/codec/FormHttpMessageWriterTests.java index dd1c9c9d2d..1bd1fff361 100644 --- a/spring-web/src/test/java/org/springframework/http/codec/FormHttpMessageWriterTests.java +++ b/spring-web/src/test/java/org/springframework/http/codec/FormHttpMessageWriterTests.java @@ -44,6 +44,10 @@ public class FormHttpMessageWriterTests { ResolvableType.forClassWithGenerics(MultiValueMap.class, String.class, String.class), MediaType.APPLICATION_FORM_URLENCODED)); + assertTrue(this.writer.canWrite( + ResolvableType.forInstance(new LinkedMultiValueMap()), + MediaType.APPLICATION_FORM_URLENCODED)); + assertFalse(this.writer.canWrite( ResolvableType.forClassWithGenerics(MultiValueMap.class, String.class, Object.class), MediaType.APPLICATION_FORM_URLENCODED));