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

Claus Ibsen updated CAMEL-21418:
--------------------------------
    Fix Version/s: 4.8.3
                   4.10.0

> 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
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 4.8.3, 4.10.0
>
>
> 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)

Reply via email to