<commit_before>using System;
using System.Net;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;

namespace WalletWasabi.Tor.Http
{
	/// <summary>
	/// HTTP client implementation based on .NET's <see cref="HttpClient"/> which provides least privacy for Wasabi users,
	/// as HTTP requests are being sent over clearnet.
	/// </summary>
	/// <remarks>Inner <see cref="HttpClient"/> instance is thread-safe.</remarks>
	public class ClearnetHttpClient : IRelativeHttpClient
	{
		static ClearnetHttpClient()
		{
			var socketHandler = new SocketsHttpHandler()
			{
				AutomaticDecompression = DecompressionMethods.All,
				PooledConnectionLifetime = TimeSpan.FromMinutes(5)
			};

			socketHandler.SslOptions.EnabledSslProtocols = IHttpClient.SupportedSslProtocols;

			HttpClient = new HttpClient(socketHandler);
		}

		public ClearnetHttpClient(Func<Uri> destinationUriAction)
		{
			DestinationUriAction = destinationUriAction;
		}

		public Func<Uri> DestinationUriAction { get; }

		/// <summary>Predefined HTTP client that handles HTTP requests when Tor is disabled.</summary>
		private static HttpClient HttpClient { get; }

		/// <inheritdoc cref="HttpClient.SendAsync(HttpRequestMessage, CancellationToken)"/>
		public Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken token = default)
		{<commit_msg>Partial revert.<commit_after>using System;
using System.Net;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;

namespace WalletWasabi.Tor.Http
{
	/// <summary>
	/// HTTP client implementation based on .NET's <see cref="HttpClient"/> which provides least privacy for Wasabi users,
	/// as HTTP requests are being sent over clearnet.
	/// </summary>
	/// <remarks>Inner <see cref="HttpClient"/> instance is thread-safe.</remarks>
	public class ClearnetHttpClient : IRelativeHttpClient
	{
		static ClearnetHttpClient()
		{
			var socketHandler = new SocketsHttpHandler()
			{
				// Only GZip is currently used by Wasabi Backend.
				AutomaticDecompression = DecompressionMethods.GZip,
				PooledConnectionLifetime = TimeSpan.FromMinutes(5)
			};

			socketHandler.SslOptions.EnabledSslProtocols = IHttpClient.SupportedSslProtocols;

			HttpClient = new HttpClient(socketHandler);
		}

		public ClearnetHttpClient(Func<Uri> destinationUriAction)
		{
			DestinationUriAction = destinationUriAction;
		}

		public Func<Uri> DestinationUriAction { get; }

		/// <summary>Predefined HTTP client that handles HTTP requests when Tor is disabled.</summary>
		private static HttpClient HttpClient { get; }

		/// <inheritdoc cref="HttpClient.SendAsync(HttpRequestMessage, CancellationToken)"/>
		public Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken token = default)
		{
{'fraction_non_alphanumeric': 0.0968783638320775, 'fraction_numerical': 0.0007176175098672408, 'mean_word_length': 4.724845995893224, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '402200', 'n_tokens_mistral': 850, 'n_tokens_neox': 787, 'n_words': 203}