You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2025/10/20 06:32:12 UTC

(httpcomponents-client) branch master updated: Content compression executors no longer remove headers from the original response message

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

olegk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git


The following commit(s) were added to refs/heads/master by this push:
     new 56122fd33 Content compression executors no longer remove headers from the original response message
56122fd33 is described below

commit 56122fd33fb8a67d23369a81f6e1d89aabf4ba10
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Sun Oct 19 18:50:03 2025 +0200

    Content compression executors no longer remove headers from the original response message
---
 .../hc/client5/http/impl/async/ContentCompressionAsyncExec.java      | 5 +----
 .../apache/hc/client5/http/impl/classic/ContentCompressionExec.java  | 3 ---
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/ContentCompressionAsyncExec.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/ContentCompressionAsyncExec.java
index cae264a0d..d8c9a6aa4 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/ContentCompressionAsyncExec.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/ContentCompressionAsyncExec.java
@@ -43,8 +43,8 @@
 import org.apache.hc.client5.http.async.methods.InflatingZstdDataConsumer;
 import org.apache.hc.client5.http.entity.compress.ContentCoding;
 import org.apache.hc.client5.http.impl.Brotli4jRuntime;
-import org.apache.hc.client5.http.impl.ZstdRuntime;
 import org.apache.hc.client5.http.impl.ContentCodingSupport;
+import org.apache.hc.client5.http.impl.ZstdRuntime;
 import org.apache.hc.client5.http.protocol.HttpClientContext;
 import org.apache.hc.core5.annotation.Contract;
 import org.apache.hc.core5.annotation.Internal;
@@ -150,9 +150,6 @@ public AsyncDataConsumer handleResponse(final HttpResponse rsp,
                             throw new HttpException("Unsupported Content-Encoding: " + codec);
                         }
                     }
-                    rsp.removeHeaders(HttpHeaders.CONTENT_ENCODING);
-                    rsp.removeHeaders(HttpHeaders.CONTENT_LENGTH);
-                    rsp.removeHeaders(HttpHeaders.CONTENT_MD5);
                     return downstream;
                 }
 
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/ContentCompressionExec.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/ContentCompressionExec.java
index e3dca2d09..f4da426ec 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/ContentCompressionExec.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/ContentCompressionExec.java
@@ -138,9 +138,6 @@ public ClassicHttpResponse execute(
                         throw new HttpException("Unsupported Content-Encoding: " + codec);
                     }
                 }
-                response.removeHeaders(HttpHeaders.CONTENT_LENGTH);
-                response.removeHeaders(HttpHeaders.CONTENT_ENCODING);
-                response.removeHeaders(HttpHeaders.CONTENT_MD5);
             }
         }
         return response;