Skip to content

Commit 56122fd

Browse files
committed
Content compression executors no longer remove headers from the original response message
1 parent 799bbc9 commit 56122fd

2 files changed

Lines changed: 1 addition & 7 deletions

File tree

httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/ContentCompressionAsyncExec.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
import org.apache.hc.client5.http.async.methods.InflatingZstdDataConsumer;
4444
import org.apache.hc.client5.http.entity.compress.ContentCoding;
4545
import org.apache.hc.client5.http.impl.Brotli4jRuntime;
46-
import org.apache.hc.client5.http.impl.ZstdRuntime;
4746
import org.apache.hc.client5.http.impl.ContentCodingSupport;
47+
import org.apache.hc.client5.http.impl.ZstdRuntime;
4848
import org.apache.hc.client5.http.protocol.HttpClientContext;
4949
import org.apache.hc.core5.annotation.Contract;
5050
import org.apache.hc.core5.annotation.Internal;
@@ -150,9 +150,6 @@ public AsyncDataConsumer handleResponse(final HttpResponse rsp,
150150
throw new HttpException("Unsupported Content-Encoding: " + codec);
151151
}
152152
}
153-
rsp.removeHeaders(HttpHeaders.CONTENT_ENCODING);
154-
rsp.removeHeaders(HttpHeaders.CONTENT_LENGTH);
155-
rsp.removeHeaders(HttpHeaders.CONTENT_MD5);
156153
return downstream;
157154
}
158155

httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/ContentCompressionExec.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,6 @@ public ClassicHttpResponse execute(
138138
throw new HttpException("Unsupported Content-Encoding: " + codec);
139139
}
140140
}
141-
response.removeHeaders(HttpHeaders.CONTENT_LENGTH);
142-
response.removeHeaders(HttpHeaders.CONTENT_ENCODING);
143-
response.removeHeaders(HttpHeaders.CONTENT_MD5);
144141
}
145142
}
146143
return response;

0 commit comments

Comments
 (0)