From cd40a968a2737b96727cc6f6d5fb81c195b4557e Mon Sep 17 00:00:00 2001 From: BenScott Date: Mon, 4 Mar 2024 13:33:36 +1300 Subject: [PATCH] if doesn't support automatic decompression then don't do it --- src/ConfigCatClient/HttpConfigFetcher.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ConfigCatClient/HttpConfigFetcher.cs b/src/ConfigCatClient/HttpConfigFetcher.cs index a015411c..92f6a0fb 100644 --- a/src/ConfigCatClient/HttpConfigFetcher.cs +++ b/src/ConfigCatClient/HttpConfigFetcher.cs @@ -249,10 +249,12 @@ private HttpClient CreateHttpClient() if (this.httpClientHandler is null) { - client = new HttpClient(new HttpClientHandler + var handler = new HttpClientHandler(); + if (handler.SupportsAutomaticDecompression) { - AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate - }); + handler.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate; + } + client = new HttpClient(handler); } else {