From b1b05c8f6baa67a8cadf0c145239b8fdd7da73b9 Mon Sep 17 00:00:00 2001 From: Jkorf Date: Mon, 28 Oct 2024 13:41:58 +0100 Subject: [PATCH] Added catch around HttpClientHandler.AutomaticDecompression setting as it's not support on Blazor WASM --- CryptoExchange.Net/Requests/RequestFactory.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CryptoExchange.Net/Requests/RequestFactory.cs b/CryptoExchange.Net/Requests/RequestFactory.cs index 689bcc5..9f007e5 100644 --- a/CryptoExchange.Net/Requests/RequestFactory.cs +++ b/CryptoExchange.Net/Requests/RequestFactory.cs @@ -19,7 +19,12 @@ namespace CryptoExchange.Net.Requests if (client == null) { var handler = new HttpClientHandler(); - handler.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate; + try + { + handler.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate; + } + catch (PlatformNotSupportedException) { } + if (proxy != null) { handler.Proxy = new WebProxy