diff --git a/Utilities/Download.cs b/Utilities/Download.cs index c706ed3..3987553 100644 --- a/Utilities/Download.cs +++ b/Utilities/Download.cs @@ -15,6 +15,12 @@ public static class Download { private static readonly Lazy s_httpClient = new(CreateHttpClient); + /// + /// Gets or sets the HTTP client timeout in seconds. Default is 180 seconds. + /// Changes to this property only take effect before the first HTTP request is made. + /// + public static int TimeoutSeconds { get; set; } = 180; + /// /// Gets content information (size and last modified time) from a URI. /// @@ -224,7 +230,7 @@ public static Uri CreateUri(string url, string? userName = null, string? passwor private static HttpClient CreateHttpClient() { - HttpClient client = new() { Timeout = TimeSpan.FromSeconds(180) }; + HttpClient client = new() { Timeout = TimeSpan.FromSeconds(TimeoutSeconds) }; Assembly assembly = Assembly.GetExecutingAssembly(); string productName = assembly.GetName().Name ?? "InsaneGenius.Utilities";