0
votes

The Content-Type is not set in HttpBinding if an end-user has provided one as a OUT header.

So if an user exposes a Jetty service and lets requests fly in that is text/plain and want to return a response that is application/json or application/xml or the likes the content type can not be set as: exchange.getOut().setHeader("Content-Type", "application/json");

Camel Version: 2.9.2 Camel Jetty Jar Version 2.9.0

Problem statement: Although I include the statement setHeader("Content-Type", "application/json"); or setHeader("Content-Type", "application/xml");, upon debugging I can see the following behaviour.

1.) Class "DefaultHeaderFilterStrategy", method "doFiltering" contains "Content-Type" as one of the filters to skip. Thus it removes the "Content-Type" from header if mentioned explicitly also.

1

1 Answers

0
votes

Can you try with Camel 2.9.4 as we have fixed a number of bugs since that release.