mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-02-02 08:09:16 +00:00
23 lines
656 B
C#
23 lines
656 B
C#
using System;
|
|
using System.Net;
|
|
using System.Net.Http;
|
|
|
|
namespace DiscordChatExporter.Domain.Internal
|
|
{
|
|
internal static class Singleton
|
|
{
|
|
private static readonly Lazy<HttpClient> LazyHttpClient = new Lazy<HttpClient>(() =>
|
|
{
|
|
var handler = new HttpClientHandler();
|
|
|
|
if (handler.SupportsAutomaticDecompression)
|
|
handler.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;
|
|
|
|
handler.UseCookies = false;
|
|
|
|
return new HttpClient(handler, true);
|
|
});
|
|
|
|
public static HttpClient HttpClient { get; } = LazyHttpClient.Value;
|
|
}
|
|
} |