reta commented on code in PR #3563:
URL: https://github.com/apache/cxf/pull/3563#discussion_r4235852213
##########
core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java:
##########
@@ -412,14 +412,15 @@ public static Attachment createAttachment(InputStream
stream, Map<String, List<S
AttachmentImpl att = new AttachmentImpl(id);
+ String cd = getHeader(headers, "Content-Disposition");
+ String fileName = getContentDispositionFileName(cd);
+
String ct = getHeader(headers, "Content-Type");
if (StringUtils.isEmpty(ct)) {
- ct = MessageUtils.getContextualString(message,
ATTACHMENT_CONTENT_TYPE, "application/octet-stream");
+ ct = MessageUtils.getContextualString(message,
ATTACHMENT_CONTENT_TYPE,
+ getDefaultContentType(cd));
Review Comment:
We probably could pass `filename` to `getDefaultContentType` (since we
already exacted it:
```suggestion
ct = MessageUtils.getContextualString(message, ATTACHMENT_CONTENT_TYPE,
getDefaultContentType(cd,
filename));
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]