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/24 10:58:00 UTC

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

    [ https://issues.apache.org/jira/browse/CAMEL-20037?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17779021#comment-17779021 ] 

Claus Ibsen commented on CAMEL-20037:
-------------------------------------

You are welcome to send a PR against main branch

> 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.1.0
>            Reporter: Simo Kivimäki
>            Priority: Major
>
> 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)