From 985600c2f91c1b388187d09e50a0d3af40cf6bdc Mon Sep 17 00:00:00 2001 From: benOnside <73915550+benOnside@users.noreply.github.com> Date: Fri, 8 Mar 2024 04:28:08 +1300 Subject: [PATCH] if doesn't support automatic decompression then don't do it (#90) --- 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 {