reta commented on code in PR #3572:
URL: https://github.com/apache/cxf/pull/3572#discussion_r4282601808


##########
rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/EntityPartProvider.java:
##########
@@ -165,13 +166,13 @@ private <T> EntityPart fromAttachment(Attachment 
attachment, Class<T> c, final T
             final InputStream is = 
attachment.getDataHandler().getInputStream();
             final ContentDisposition cd = attachment.getContentDisposition();
             
-            final String fileName = (cd != null) ? cd.getFilename() : null;
+            final String rawFileName = (cd != null) ? cd.getFilename() : null;
             final String cdName = cd == null ? null : cd.getParameter("name");
             final String contentId = attachment.getContentId();
 
-            if (!StringUtils.isEmpty(fileName)) {
-                return new EntityPartImpl(mc.getProviders(), contentId, 
fileName, is, c, genericType,
-                    attachment.getHeaders(), attachment.getContentType());
+            if (!StringUtils.isEmpty(rawFileName)) {

Review Comment:
   This is an issue, I think we should be using filename consistently otherwise 
the part will not be properly send over back to the client 
([EntityPartProvider.java](https://github.com/apache/cxf/pull/3572/changes/BASE..338a448c68f26c75026b1f5c58bbde46b843197a#diff-beb81f97d6e35fcc085bfc3cef60e4dee178210d389ae5941f1dc848f1b13de4R215),
 the filename is pass-through for `EntityPartImpl`, we could probably keep it 
as raw?



##########
rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/EntityPartProvider.java:
##########
@@ -165,13 +166,13 @@ private <T> EntityPart fromAttachment(Attachment 
attachment, Class<T> c, final T
             final InputStream is = 
attachment.getDataHandler().getInputStream();
             final ContentDisposition cd = attachment.getContentDisposition();
             
-            final String fileName = (cd != null) ? cd.getFilename() : null;
+            final String rawFileName = (cd != null) ? cd.getFilename() : null;
             final String cdName = cd == null ? null : cd.getParameter("name");
             final String contentId = attachment.getContentId();
 
-            if (!StringUtils.isEmpty(fileName)) {
-                return new EntityPartImpl(mc.getProviders(), contentId, 
fileName, is, c, genericType,
-                    attachment.getHeaders(), attachment.getContentType());
+            if (!StringUtils.isEmpty(rawFileName)) {

Review Comment:
   This is an issue, I think we should be using filename consistently otherwise 
the part will not be properly send over back to the client 
([EntityPartProvider.java](https://github.com/apache/cxf/pull/3572/changes/BASE..338a448c68f26c75026b1f5c58bbde46b843197a#diff-beb81f97d6e35fcc085bfc3cef60e4dee178210d389ae5941f1dc848f1b13de4R215)),
 the filename is pass-through for `EntityPartImpl`, we could probably keep it 
as raw?



-- 
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]

Reply via email to