[ 
https://issues.apache.org/jira/browse/CAMEL-26139?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen resolved CAMEL-26139.
---------------------------------
    Resolution: Fixed

Fixed by https://github.com/apache/camel/pull/28912 (merged to main as 
958036619c2828853254818fda4488d1565b5d4f).

_Claude Code on behalf of Claus Ibsen (davsclaus)_

> camel-servlet - attachmentMultipartBinding=true fails every non-multipart 
> request with 500 Cannot populate attachments
> ----------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-26139
>                 URL: https://issues.apache.org/jira/browse/CAMEL-26139
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-servlet
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 4.24.0
>
>
> Found while adding the catalog body types of servlet (CAMEL-24961, PR #28395).
> h4. 1. attachmentMultipartBinding=true fails every request that is not 
> multipart
> {{AttachmentHttpBinding.populateAttachments}} (main 2a465aa4814c, line 54) 
> calls {{request.getParts()}} for every request, which throws for a request 
> that is not {{multipart/form-data}}; the exception is wrapped as "Cannot 
> populate attachments" (line 79) and the client gets a 500. So a servlet 
> endpoint with {{attachmentMultipartBinding=true}} cannot serve a plain POST 
> or GET. Checked on 4.24.0-SNAPSHOT with a java.net.http client against a 
> servlet consumer in the Undertow servlet container.
> Proposed: only read the parts when the Content-Type is {{multipart/*}}.
> _Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to