Dear Camel team,
While working on one integration we found issue related to camel-http component when solution is deployed on IBM Liberty core.
Same issue is not reproducible on Jetty and Tomcat.
Issue is connected to the code in IOHelper and CachedOutputStream$WrappedInputStream
We are using version 2.12.4 but I can see that same code is used also in latest versions.
Problematic part are lines 196, 198 and 204.
Basically stream reader which is used org.apache.camel.converter.stream.CachedOutputStream$WrappedInputStream is not returning -1 like response of read method if empty string is provided on input.
This is wrong by specification of InputReader interface.
// in the case there is input which is empty string
while ( -1 != n)
For our use case we have applied change in IOHelper to check and directly cover if stream reader produce same (non-valid) response to not produce infinitive loop.
If any questions around reproducing issue please let me know