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 525fc7a27e
commit 912fa7602a
3 changed files with 31 additions and 4 deletions

View File

@@ -984,7 +984,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() {