Improve invalid Content-Type handling in WebFlux

Closes gh-29565
This commit is contained in:
rstoyanchev
2022-12-05 09:19:15 +00:00
parent 4a555aaef1
commit 913163884a
3 changed files with 31 additions and 4 deletions

View File

@@ -990,7 +990,8 @@ public class HttpHeaders implements MultiValueMap<String, String>, Serializable
/**
* Return the {@linkplain MediaType media type} of the body, as specified
* by the {@code Content-Type} header.
* <p>Returns {@code null} when the content-type is unknown.
* <p>Returns {@code null} when the {@code Content-Type} header is not set.
* @throws InvalidMediaTypeException if the media type value cannot be parsed
*/
@Nullable
public MediaType getContentType() {