add support for brotli compression

This commit is contained in:
Athou
2026-10-14 07:37:31 +02:00
parent 69c1e8a5b8
commit b865b3ff84
4 changed files with 14 additions and 14 deletions

View File

@@ -20,6 +20,7 @@ import nl.altindag.ssl.apache5.util.Apache5SslUtils;
import org.apache.hc.client5.http.DnsResolver;
import org.apache.hc.client5.http.SystemDefaultDnsResolver;
import org.apache.hc.client5.http.async.methods.InflatingAsyncDataConsumer;
import org.apache.hc.client5.http.async.methods.InflatingBrotliDataConsumer;
import org.apache.hc.client5.http.async.methods.InflatingGzipDataConsumer;
import org.apache.hc.client5.http.async.methods.InflatingZstdDataConsumer;
import org.apache.hc.client5.http.config.ConnectionConfig;
@@ -92,6 +93,7 @@ public class HttpClientFactory {
ContentCoding.DEFLATE.token(), d -> new InflatingAsyncDataConsumer(d, null));
contentDecoderMap.put(ContentCoding.GZIP.token(), InflatingGzipDataConsumer::new);
contentDecoderMap.put(ContentCoding.ZSTD.token(), InflatingZstdDataConsumer::new);
contentDecoderMap.put(ContentCoding.BROTLI.token(), InflatingBrotliDataConsumer::new);
RedirectStrategy redirectStrategy =
config.httpClient().blockLocalAddresses()