[ https://issues.apache.org/jira/browse/CAMEL-21418?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Olivier Jacquemart updated CAMEL-21418: --------------------------------------- Description: 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. was: 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. > camel-rest - Client request validation and empty body > ----------------------------------------------------- > > 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)