You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Olivier Jacquemart (Jira)" <ji...@apache.org> on 2024/11/05 13:41:00 UTC
[jira] [Updated] (CAMEL-21418) camel-rest - Client request validation and multiple values in Accept header
[ https://issues.apache.org/jira/browse/CAMEL-21418?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Olivier Jacquemart updated CAMEL-21418:
---------------------------------------
Summary: camel-rest - Client request validation and multiple values in Accept header (was: camel-rest - Client request validation and empty body)
> camel-rest - Client request validation and multiple values in Accept header
> ---------------------------------------------------------------------------
>
> Key: CAMEL-21418
> URL: https://issues.apache.org/jira/browse/CAMEL-21418
> Project: Camel
> Issue Type: Bug
> Components: camel-core
> Affects Versions: 4.8.1
> Reporter: Olivier Jacquemart
> Priority: Minor
>
> I have a problem regarding a rest route and a client sending multiple values in the Accept header. The route has the client request validation enabled.
> {code:java}
> # succeeds
> $ curl -v -H "Accept: application/json" localhost:8080/api/hello
> {"message":"hello world"}
> # fails
> $ curl -v -H "Accept: application/xml, application/json" localhost:8080/api/hello
> Response status is https://http.cat/406
> {code}
> After a quick debug, I ended up in the [RestUtil |https://github.com/apache/camel/blob/main/core/camel-support/src/main/java/org/apache/camel/support/http/RestUtil.java] class that returns false by default. It considers the accept header like invalid then and gives the 406.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)