This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch camel-4.0.x in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-4.0.x by this push: new a1d2770bf9a CAMEL-20362 - Camel-Netty-HTTP: Headers validation should be enabled by default (#12884) a1d2770bf9a is described below commit a1d2770bf9a9a4676d466d7c20bba5df4d7e926e Author: Andrea Cosentino <anco...@gmail.com> AuthorDate: Wed Jan 24 10:37:30 2024 +0100 CAMEL-20362 - Camel-Netty-HTTP: Headers validation should be enabled by default (#12884) Signed-off-by: Andrea Cosentino <anco...@gmail.com> --- .../apache/camel/component/netty/http/DefaultNettyHttpBinding.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/DefaultNettyHttpBinding.java b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/DefaultNettyHttpBinding.java index 33a420d5f8e..f852248e936 100644 --- a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/DefaultNettyHttpBinding.java +++ b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/DefaultNettyHttpBinding.java @@ -464,7 +464,7 @@ public class DefaultNettyHttpBinding implements NettyHttpBinding, Cloneable { if (body instanceof InputStream && configuration.isDisableStreamCache()) { response = new OutboundStreamHttpResponse( - (InputStream) body, new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.valueOf(code), false)); + (InputStream) body, new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.valueOf(code), true)); response.headers().set(TRANSFER_ENCODING, CHUNKED); } @@ -493,7 +493,7 @@ public class DefaultNettyHttpBinding implements NettyHttpBinding, Cloneable { } if (buffer != null) { - response = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.valueOf(code), buffer, false); + response = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.valueOf(code), buffer, true); // We just need to reset the readerIndex this time if (buffer.readerIndex() == buffer.writerIndex()) { buffer.setIndex(0, buffer.writerIndex());