mirror of
https://github.com/Cleanuparr/Cleanuparr.git
synced 2026-09-13 05:47:33 -04:00
Add option to send the User-Agent header on all HTTP requests (#750)
This commit is contained in:
1 parent
8f8f30c37a
commit
41dbbf155b
38 files changed
+4878
-67
No files matched your search
+5
-20
@@ -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,
|
||||
}
|
||||
Reference in new issue
Block a user