Skip to content

Commit 003a5f0

Browse files
committed
Fixed V1 client by not setting accept-encoding when compression is lz4 to reflect logic in headers builder
1 parent 4706771 commit 003a5f0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

clickhouse-http-client/src/main/java/com/clickhouse/client/http/ClickHouseHttpConnection.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,11 +275,10 @@ protected static Map<String, String> createDefaultHeaders(ClickHouseConfig confi
275275
}
276276
// Also, you can use the ‘default_format’ URL parameter
277277
map.put("x-clickhouse-format", config.getFormat().name());
278-
if (config.isResponseCompressed()) {
278+
if (config.isResponseCompressed() && config.getResponseCompressAlgorithm() != ClickHouseCompression.LZ4) {
279279
map.put("accept-encoding", config.getResponseCompressAlgorithm().encoding());
280280
}
281-
if (config.isRequestCompressed()
282-
&& config.getRequestCompressAlgorithm() != ClickHouseCompression.LZ4) {
281+
if (config.isRequestCompressed() && config.getRequestCompressAlgorithm() != ClickHouseCompression.LZ4) {
283282
map.put("content-encoding", config.getRequestCompressAlgorithm().encoding());
284283
}
285284
return map;

0 commit comments

Comments
 (0)