From 6c89e3f8ecf5aadc7e34ff4c4c8eb2ca14c13211 Mon Sep 17 00:00:00 2001 From: Nedim Basic Date: Tue, 4 Jul 2023 07:15:59 -0400 Subject: [PATCH] Adjusted Timeout setter to throw an out of range exception. --- src/HtmlAgilityPack.Shared/HtmlWeb.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/HtmlAgilityPack.Shared/HtmlWeb.cs b/src/HtmlAgilityPack.Shared/HtmlWeb.cs index 1c7fcad3..e1077ca5 100644 --- a/src/HtmlAgilityPack.Shared/HtmlWeb.cs +++ b/src/HtmlAgilityPack.Shared/HtmlWeb.cs @@ -803,12 +803,12 @@ internal static HttpClient GetSharedHttpClient(string userAgent) public DecompressionMethods AutomaticDecompression { get; set; } /// - /// Gets or sets the timeout value in milliseconds. + /// Gets or sets the timeout value in milliseconds. Must be greater than zero. /// public int Timeout { get { return _timeout; } - set { if (value < 0) { _timeout = 0; } else { _timeout = value; } } + set { if (value <= 0) { throw new ArgumentOutOfRangeException(); } else { _timeout = value; } } } ///