Skip to content

WebFlux decodes wildcard content-types as form-data/multipart #34660

Closed
@Dodomix

Description

@Dodomix

Bug description

I'm having an issue with form data when using content type /. I managed to pinpoint it to this fix on Jackson Databind.
What happens now when initializing form data in DefaultServerWebExchange (code) is that JSON mappers also say they can read form data (here) and parsing therefore fails (because they can't).
Before this Jackson fix, ObjectMapper answered that it couldn't deserialize MultiValueMap.

Bug reproduce

Here is the simplest dummy app I've managed to build which replicates the issue: https://github.com/Dodomix/form-data-jackson-bug. The test fails with version 3.4.4 of Spring Boot, and passes with 3.4.3 (change in Jackson 2.18.2 -> 2.18.3). I'm opening the report here because the problematic code is in spring-web.

The exact behavior which changed in Jackson:

var objectMapper = new ObjectMapper();
objectMapper.canDeserialize(objectMapper.constructType(MultiValueMap.class));

Expected behavior

All tests pass.

System info

Java: Temurin 24

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions