[
https://issues.apache.org/jira/browse/CAMEL-20210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17795230#comment-17795230
]
Claus Ibsen commented on CAMEL-20210:
-------------------------------------
Yes I will correct this, and your example now works
{code}
curl -vv http://localhost:8080/test/xml -d "bleepbloop" -H "Content-Type:
application/xml; charset=utf-8"
* Trying 127.0.0.1:8080...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> POST /test/xml HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.88.1
> Accept: */*
> Content-Type: application/xml; charset=utf-8
> Content-Length: 10
>
< HTTP/1.1 200 OK
< Server: Jetty(12.0.4)
< Content-Type: application/xml; charset=utf-8
< Accept: */*
< User-Agent: curl/7.88.1
< Transfer-Encoding: chunked
<
* Connection #0 to host localhost left intact
hello from the xml route%
{code}
> 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
> Assignee: Claus Ibsen
> Priority: Minor
> Fix For: 4.3.0
>
> 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)