You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2024/01/24 09:15:24 UTC

(camel) branch CAMEL-20362-4.0.x created (now f1e58ad4918)

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a change to branch CAMEL-20362-4.0.x
in repository https://gitbox.apache.org/repos/asf/camel.git


      at f1e58ad4918 CAMEL-20362 - Camel-Netty-HTTP: Headers validation should be enabled by default

This branch includes the following new commits:

     new f1e58ad4918 CAMEL-20362 - Camel-Netty-HTTP: Headers validation should be enabled by default

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(camel) 01/01: CAMEL-20362 - Camel-Netty-HTTP: Headers validation should be enabled by default

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch CAMEL-20362-4.0.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit f1e58ad491820aa4cfb21cf6144d7da1fdf46b5f
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Jan 24 10:13:45 2024 +0100

    CAMEL-20362 - Camel-Netty-HTTP: Headers validation should be enabled by default
    
    Signed-off-by: Andrea Cosentino <an...@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());