You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "SUYASH MANI SHARMA (Jira)" <ji...@apache.org> on 2020/11/25 04:58:00 UTC
[jira] [Created] (CAMEL-15891) camel-ahc body for String data
SUYASH MANI SHARMA created CAMEL-15891:
------------------------------------------
Summary: camel-ahc body for String data
Key: CAMEL-15891
URL: https://issues.apache.org/jira/browse/CAMEL-15891
Project: Camel
Issue Type: Bug
Components: camel-ahc
Affects Versions: 2.24.2
Reporter: SUYASH MANI SHARMA
the issue is due to a mistake done by async-http-client team.
Commit : [https://github.com/AsyncHttpClient/async-http-client/commit/d47c56e7ee80b76a4cffd4770237239cfea0ffd6#diff-5247ce5d437efdde629533d6239bf0c24358bdf0157fa204050e908c48a8c1f3]
They made the ByteArrayBodyGenerator constructor package level.
Due to this change, camel had to adapt and for String type of body, they changed their implementation from ByteArrayBodyGenerator to InputStreamBodyGenerator.
In InputStreamBodyGenerator, the content length is by default set to -1.
Since, content length was less than 0, NettyRequestFactory in async-http-client was using Transfer-Encoding header instead of Content-Length header.
Solution :
Async-http-client team corrected their mistake in the following commit :
[https://github.com/AsyncHttpClient/async-http-client/commit/4469c30f7d54352865ff321b0de0148f9698c9b5#diff-208f8952b67ba2a28d2cb2d6881485f8fc1b2b5df53a841d4a4a48b2ed8aded0]
However, the change was not reverted in camel, and hence, this regression has happened.
The change needs to be reverted in camel as well. This is causing regression when we are migrating from lower camel versions to higher versions.
The change was introduced with the following commit.
[https://github.com/apache/camel/commit/684ef5786838e051cece2f510d9dafabdc310d02#diff-4d41a9fe212a88af9bc5cddb7e348f8031f39ceaf2263d7275fc4b6dd09e0867]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)