Skip to content

Commit

Permalink
feat(IpfsClient): request compressed responses from the server.
Browse files Browse the repository at this point in the history
Let's save bandwidth. See ipfs/kubo#4385
  • Loading branch information
richardschneider committed Nov 13, 2017
1 parent ca349a1 commit a778f25
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/IpfsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,13 @@ HttpClient Api()
{
if (api == null)
{
api = new HttpClient();
var handler = new HttpClientHandler();
if (handler.SupportsAutomaticDecompression)
{
handler.AutomaticDecompression = DecompressionMethods.GZip
| DecompressionMethods.Deflate;
}
api = new HttpClient(handler);
api.DefaultRequestHeaders.Add("User-Agent", UserAgent);
}
}
Expand Down

0 comments on commit a778f25

Please sign in to comment.