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


##########
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:
   Wondering why we check `rawFileName` but pass 
`FileUtils.safeFileName(rawFileName)`? The latter could return null or empty 
string even if `rawFileName` is not



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