-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: bugA general bugA general bug
Milestone
Description
Jan Dudek opened SPR-10982 and commented
I believe there's a glitch in org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodArgumentResolver#readWithMessageConverters(...)
. At the beginning of this method the Content-Type header must be obtained:
MediaType contentType = inputMessage.getHeaders().getContentType();
if (contentType == null) {
contentType = MediaType.APPLICATION_OCTET_STREAM;
}
If the getContentType()
call fails (for example for Content-Type: Hello
), a InvalidMediaTypeException
is thrown.
I believe this exception should be caught here and re-thrown as HttpMediaTypeNotSupportedException
which would be eventually translated to a 415 http status code (since in my opinion this is a 415 situation).
Affects: 3.2.4
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: bugA general bugA general bug