1
0
mirror of https://github.com/JKorf/CryptoExchange.Net synced 2025-06-08 00:16:27 +00:00

Added catch around HttpClientHandler.AutomaticDecompression setting as it's not support on Blazor WASM

This commit is contained in:
Jkorf 2024-10-28 13:41:58 +01:00
parent a0e588c3de
commit b1b05c8f6b

View File

@ -19,7 +19,12 @@ namespace CryptoExchange.Net.Requests
if (client == null) if (client == null)
{ {
var handler = new HttpClientHandler(); var handler = new HttpClientHandler();
handler.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate; try
{
handler.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;
}
catch (PlatformNotSupportedException) { }
if (proxy != null) if (proxy != null)
{ {
handler.Proxy = new WebProxy handler.Proxy = new WebProxy