diff --git a/src/Models/ClientOptions.cs b/src/Models/ClientOptions.cs index fea0947..00a747f 100644 --- a/src/Models/ClientOptions.cs +++ b/src/Models/ClientOptions.cs @@ -1,4 +1,5 @@ using System; +using System.Net; using System.Net.Http; using StreamChat.Exceptions; @@ -9,7 +10,10 @@ namespace StreamChat.Models /// public class ClientOptions { - private static readonly HttpClient DefaultHttpClient = new HttpClient(); + private static readonly HttpClient DefaultHttpClient = new HttpClient(new HttpClientHandler + { + AutomaticDecompression = DecompressionMethods.GZip, + }); /// The instance used for underlying HTTP calls. public HttpClient HttpClient { get; set; } = DefaultHttpClient; @@ -29,6 +33,7 @@ static ClientOptions() // AWS load balancer disconnects in 60 seconds, so let's make it 59 var socketsHandler = new SocketsHttpHandler(); socketsHandler.PooledConnectionLifetime = TimeSpan.FromSeconds(59); + socketsHandler.AutomaticDecompression = DecompressionMethods.GZip; DefaultHttpClient = new HttpClient(socketsHandler); } #endif