You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2023/10/25 09:06:00 UTC

[jira] [Resolved] (CAMEL-20037) camel-http builds StringEntity with wrong contentEncoding

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

Claus Ibsen resolved CAMEL-20037.
---------------------------------
    Resolution: Fixed

Thanks for reporting and the PR

> camel-http builds StringEntity with wrong contentEncoding
> ---------------------------------------------------------
>
>                 Key: CAMEL-20037
>                 URL: https://issues.apache.org/jira/browse/CAMEL-20037
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-http
>    Affects Versions: 4.0.1, 4.1.0
>            Reporter: Simo Kivimäki
>            Priority: Major
>             Fix For: 4.0.3, 4.2.0
>
>
> HttpProducer.java line 781:
> {code:java}
> answer = new StringEntity(content, contentType, charset, false);
> {code}
> Here the third parameter should be contentEncoding (e.g. null). Not charset.
> This will produce HTTP request having for example header:
> {code}
> Content-Encoding: utf-8
> {code}
> UTF-8 is not allowed Content-Encoding. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding.
> Some http servers returns HTTP 415 Unsupported Media Type because of that.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)