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:12 UTC

(camel) branch CAMEL-20362 created (now 9d851a667e0)

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

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


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

This branch includes the following new commits:

     new 9d851a667e0 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
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 9d851a667e005c8195f7615a46f4589da88c93bd
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 43e1ca67438..0b99bd8e22e 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
@@ -487,7 +487,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);
         }
 
@@ -516,7 +516,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());