Add option to send the User-Agent header on all HTTP requests (#750)

This commit is contained in:
Flaminel authored and GitHub committed 2026-08-22 22:18:49 +03:00
1 parent 8f8f30c37a
commit 41dbbf155b
38 files changed
+4878 -67

No files matched your search

@@ -12,30 +12,15 @@ public class HttpClientConfig
public int Timeout { get; set; }
public HttpClientType Type { get; set; }
public RetryConfig? RetryConfig { get; set; }
// Deluge-specific settings
public bool AllowAutoRedirect { get; set; } = true;
public DecompressionMethods AutomaticDecompression { get; set; } = DecompressionMethods.GZip | DecompressionMethods.Deflate;
public CertificateValidationType CertificateValidationType { get; set; } = CertificateValidationType.Enabled;
}
/// <summary>
/// Retry configuration for HTTP clients
/// </summary>
public class RetryConfig
{
public int MaxRetries { get; set; }
public bool ExcludeUnauthorized { get; set; } = true;
/// <summary>
/// Whether requests from this client carry a User-Agent header.
/// </summary>
public bool SendUserAgent { get; set; }
}
/// <summary>
/// Types of HTTP clients that can be configured
/// </summary>
public enum HttpClientType
{
Default,
WithRetry,
Deluge,
UTorrent,
}