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


##########
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:
   makes sense, the round-trip through EntityPartImpl is the deciding factor. 
i've switched both EntityPartProvider and EntityPartUtils back to the raw 
filename, so a part that's just read and forwarded keeps exactly what it came 
in with. the sanitising now only lives in the opt-in 
ContentDisposition.getFilenameSanitized() that getFilename()'s javadoc points 
callers at, rather than being forced on the pass-through path. tests updated to 
match.



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