[
https://issues.apache.org/jira/browse/CAMEL-11028?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15940146#comment-15940146
]
ASF GitHub Bot commented on CAMEL-11028:
----------------------------------------
GitHub user jbridger opened a pull request:
https://github.com/apache/camel/pull/1568
CAMEL-11028: Avoid duplicating content-type headers for camel-spark-rest
Fix for: https://issues.apache.org/jira/browse/CAMEL-11028
Fix is as suggested in the Jira issue. Additionally, we changed the
`DefaultSparkBindingTest.java` to exclude the `Content-Type` header when adding
request headers to the camel headers map.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/sky-uk/camel CAMEL-11028
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/camel/pull/1568.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1568
----
commit ca175b9344113fef2bc3960611cf24513ae26afa
Author: Charlie McNeill, Karthikeyan Gurunathan and Jonathan Bridger
<[email protected]>
Date: 2017-03-23T14:35:35Z
CAMEL-11028: Avoid duplicating content-type headers for camel-spark-rest
----
> camel-spark-rest - Adds duplicate content-type
> ----------------------------------------------
>
> Key: CAMEL-11028
> URL: https://issues.apache.org/jira/browse/CAMEL-11028
> Project: Camel
> Issue Type: Bug
> Components: rest
> Affects Versions: 2.18.3
> Reporter: Adam Dougal
> Assignee: Andrea Cosentino
> Fix For: 2.18.4, 2.19.0
>
>
> This is essentially the same as
> https://issues.apache.org/jira/browse/CAMEL-9613 . When I send a request
> containing a 'content-type' header it will get sent with duplicate values.
> E.g. Content-Type: \[application/json, application/json\].
> My RouteBuilder is very simple at the moment:
> {code}
> restConfiguration().component("spark-rest").port(8585);
> rest("/").post("/charges").to("direct:charges");
> from("direct:charges").to("http://localhost:8080/charges?bridgeEndpoint=true&throwExceptionOnFailure=false");
> {code}
> Having looked at the code I can see it being added in two places:
> https://github.com/apache/camel/blob/master/components/camel-spark-rest/src/main/java/org/apache/camel/component/sparkrest/DefaultSparkBinding.java#L73
> https://github.com/apache/camel/blob/master/components/camel-spark-rest/src/main/java/org/apache/camel/component/sparkrest/DefaultSparkBinding.java#L109
> Is this intended behaviour? If so, how would I disable it? Thanks
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)