[ 
https://issues.apache.org/jira/browse/CAMEL-20210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17794705#comment-17794705
 ] 

Billy Jaime Beltran commented on CAMEL-20210:
---------------------------------------------

I added a zip file containing a minimum project 

 

Run with 

mvn clean compile -Dmaven.test.skip=true

mvn camel:run

 

Then call it with

curl -vv [http://localhost:8080/test/xml] -d "bleepbloop" - H "Content-Type: 
application/xml; charset=utf-8"

> Narrow content-type with charset fails clientRequestValidation
> --------------------------------------------------------------
>
>                 Key: CAMEL-20210
>                 URL: https://issues.apache.org/jira/browse/CAMEL-20210
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 4.2.0
>            Reporter: Billy Jaime Beltran
>            Priority: Minor
>             Fix For: 4.x
>
>         Attachments: camel-20210-example.zip, tCYuXsuHaeo9.png
>
>
> We recently upgraded an application to latest camel stable and got an error 
> report from consumers when submitting a charset parameter in the content type 
> header. 
>  
> Expected: a request with content-type header `application/xml; charset=utf-8` 
> is correctly validated as part of a rest specification with 
> `.consumes(MediaType.APPLICATION_XML_VALUE)`. We run with bindingmode.off 
> Actual: fails with 415 MediaType error
> What changed? 
> In commit 
> [https://github.com/apache/camel/commit/2ce60e76a5c8496c1468558e0b6d3043c4eb0eac]
>  a change in client Request Validation was introduced which defaults 
> validation to return false instead of true.
>  
> The charset parameter is part of the Content-Type superset and is not per se 
> a MediaType. We expect setting the correct MediaType would lead to a 
> validation of MediaType and not fail on an additional charset parameter.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to