You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ff...@apache.org on 2026/01/09 22:26:21 UTC

(cxf) branch 4.0.x-fixes updated: [CXF-9111]ensure we have correct Content-Disposition set per spec

This is an automated email from the ASF dual-hosted git repository.

ffang pushed a commit to branch 4.0.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/4.0.x-fixes by this push:
     new 30a0df29b42 [CXF-9111]ensure we have correct Content-Disposition set per spec
30a0df29b42 is described below

commit 30a0df29b42a1f608e54b2c36981181a1c9f60bb
Author: Freeman Fang <fr...@gmail.com>
AuthorDate: Fri Jan 9 17:25:38 2026 -0500

    [CXF-9111]ensure we have correct Content-Disposition set per spec
    
    (cherry picked from commit 2968735a216540871780e081103e9bb892a1fbb5)
---
 .../src/main/java/org/apache/cxf/jaxrs/provider/MultipartProvider.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/MultipartProvider.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/MultipartProvider.java
index 7618e17d608..319bacf54f3 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/MultipartProvider.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/MultipartProvider.java
@@ -358,7 +358,8 @@ public class MultipartProvider extends AbstractConfigurableProvider
                                      att.getContentType().toString(), id);
             MediaType mediaType = httpHeaders.getMediaType();
             Attachment ret = null;
-            if (MediaType.MULTIPART_FORM_DATA_TYPE.isCompatible(mediaType)) {
+            if (MediaType.MULTIPART_FORM_DATA_TYPE.isCompatible(mediaType)
+                && att.getHeader("Content-Disposition") == null) {
                 ContentDisposition cd = new 
                     ContentDisposition("form-data;name=\"" 
                         + att.getContentId() + "\"");