You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Freeman Yue Fang (Jira)" <ji...@apache.org> on 2026/01/09 18:12:00 UTC
[jira] [Commented] (CXF-9111) Default behavior for "multipart/form-data" requests not standard-conform
[ https://issues.apache.org/jira/browse/CXF-9111?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18050906#comment-18050906 ]
Freeman Yue Fang commented on CXF-9111:
---------------------------------------
Hi [~tombsnard],
Thanks for reporting this, this is a reasonable change. I will address it accordingly soon.
Freeman
> Default behavior for "multipart/form-data" requests not standard-conform
> ------------------------------------------------------------------------
>
> Key: CXF-9111
> URL: https://issues.apache.org/jira/browse/CXF-9111
> Project: CXF
> Issue Type: Bug
> Affects Versions: 4.0.6
> Reporter: Christian Mattar
> Assignee: Freeman Yue Fang
> Priority: Major
>
> We are using a client interface like this:
> {noformat}
> @POST
> @Path("/checkMultipartAsAttachment")
> @Consumes(MediaType.MULTIPART_FORM_DATA)
> void checkMultipartAsObject(@Multipart(value = "part1", type = MediaType.APPLICATION_JSON) JsonData part1, @Multipart(value = "part1", type = MediaType.APPLICATION_JSON) JsonData part2);{noformat}
>
> However, the multiparts are not recognized by e.g. Spring MVC. When inspecting the internal CXF data structures, I can see that the generated Attachment objects have no Content-Disposition header, and thus, no Content-Disposition header is sent through the wire.
> Instead, a "Content-ID" header is sent. This header is also picked up by CXF on server-side, so CXF->CXF communication works.
> As far as I can tell, the currently generated request is not valid for MIME type "multipart/form-data" according to the relevant https://datatracker.ietf.org/doc/html/rfc7578 .
> (it might by valid for MIME type "multipart/related" according to https://www.ietf.org/rfc/rfc2387.txt)
> The same holds true by default for requests like this:
>
> {noformat}
> @POST
> @Path("/checkMultipartAsAttachment")
> @Consumes(MediaType.MULTIPART_FORM_DATA)
> void checkMultipartAsAttachment(Attachment multipart);
> {noformat}
> However, in these cases we could at least add the Content-Disposition Header to the Attachment-object in our own code.
> It would be great if by default, requests for "multipart/form-data" would be standards-conform.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)