Skip to content

Commit 44c52a9

Browse files
committed
Accept empty Content-Type header
Issue: SPR-12173 (cherry picked from commit 70412a9)
1 parent f2675f7 commit 44c52a9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spring-web/src/main/java/org/springframework/http/HttpHeaders.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ public void setContentType(MediaType mediaType) {
301301
*/
302302
public MediaType getContentType() {
303303
String value = getFirst(CONTENT_TYPE);
304-
return (value != null ? MediaType.parseMediaType(value) : null);
304+
return (StringUtils.hasLength(value) ? MediaType.parseMediaType(value) : null);
305305
}
306306

307307
/**

0 commit comments

Comments
 (0)