-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Closed
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancementA general enhancement
Milestone
Description
A @RestController
like
@RestController
public class DemoController {
@PostMapping
public Map<String, Object> getAttributes(@RequestBody Body body, ServerWebExchange serverWebExchange) {
return serverWebExchange.getAttribute(body.getAttribute());
}
}
is expected to handle requests with content type application/json. When the client request has a content type x-www-form-urlencoded, I would expect that the server returns 415 Unsupported Media Type or another client error.
Instead Spring throws java.lang.IllegalStateException: In a WebFlux application, form data is accessed via ServerWebExchange.getFormData().
A sample application with failing test can be found here: https://github.com/huberchrigu/spring-reactive-wrong-content-type
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancementA general enhancement