|
55 | 55 | import org.springframework.messaging.MessageHeaders;
|
56 | 56 | import org.springframework.util.Assert;
|
57 | 57 | import org.springframework.util.CollectionUtils;
|
| 58 | +import org.springframework.util.MimeType; |
58 | 59 | import org.springframework.util.ObjectUtils;
|
59 | 60 | import org.springframework.util.PatternMatchUtils;
|
60 | 61 | import org.springframework.util.StringUtils;
|
@@ -591,8 +592,8 @@ private void setHttpHeader(HttpHeaders target, String name, Object value) {
|
591 | 592 | if (!CollectionUtils.isEmpty(values)) {
|
592 | 593 | List<MediaType> acceptableMediaTypes = new ArrayList<>();
|
593 | 594 | for (Object type : values) {
|
594 |
| - if (type instanceof MediaType) { |
595 |
| - acceptableMediaTypes.add((MediaType) type); |
| 595 | + if (type instanceof MimeType) { |
| 596 | + acceptableMediaTypes.add(MediaType.asMediaType((MimeType) type)); |
596 | 597 | }
|
597 | 598 | else if (type instanceof String) {
|
598 | 599 | acceptableMediaTypes.addAll(MediaType.parseMediaTypes((String) type));
|
@@ -749,8 +750,8 @@ else if (value instanceof String) {
|
749 | 750 | }
|
750 | 751 | }
|
751 | 752 | else if (MessageHeaders.CONTENT_TYPE.equalsIgnoreCase(name)) {
|
752 |
| - if (value instanceof MediaType) { |
753 |
| - target.setContentType((MediaType) value); |
| 753 | + if (value instanceof MimeType) { |
| 754 | + target.setContentType(MediaType.asMediaType((MimeType) value)); |
754 | 755 | }
|
755 | 756 | else if (value instanceof String) {
|
756 | 757 | target.setContentType(MediaType.parseMediaType((String) value));
|
|
0 commit comments