Skip to content

Commit

Permalink
Merge pull request #58 from drasticactions/compression
Browse files Browse the repository at this point in the history
Add AutomaticDecompression to default httpclient
  • Loading branch information
drasticactions authored Sep 27, 2024
2 parents 4a5a1b2 + 4e4667b commit 85d0581
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/FishyFlip/ATProtocolOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Copyright (c) Drastic Actions. All rights reserved.
// </copyright>

using System.Net;

namespace FishyFlip;

/// <summary>
Expand Down Expand Up @@ -86,7 +88,7 @@ public ATProtocolOptions(IReadOnlyList<ICustomEmbedConverter>? customEmbedConver
/// <returns><see cref="HttpClient"/>.</returns>
internal HttpClient GenerateHttpClient(HttpMessageHandler? handler = default)
{
var httpClient = new HttpClient(handler ?? new HttpClientHandler { MaxRequestContentBufferSize = int.MaxValue });
var httpClient = new HttpClient(handler ?? new HttpClientHandler { MaxRequestContentBufferSize = int.MaxValue, AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate, });
httpClient.DefaultRequestHeaders.Add(Constants.HeaderNames.UserAgent, this.UserAgent);
httpClient.DefaultRequestHeaders.Add("Accept", Constants.AcceptedMediaType);
httpClient.BaseAddress = this.Url;
Expand Down

0 comments on commit 85d0581

Please sign in to comment.