Skip to content

Commit 70412a9

Browse files
committed
Accept empty Content-Type header
Issue: SPR-12173
1 parent 8922da3 commit 70412a9

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ public void setContentType(MediaType mediaType) {
556556
*/
557557
public MediaType getContentType() {
558558
String value = getFirst(CONTENT_TYPE);
559-
return (value != null ? MediaType.parseMediaType(value) : null);
559+
return (StringUtils.hasLength(value) ? MediaType.parseMediaType(value) : null);
560560
}
561561

562562
/**

0 commit comments

Comments
 (0)