From 0c448c6ef5492dc883edc9222a0bc51964369e0f Mon Sep 17 00:00:00 2001 From: Nedim Basic Date: Tue, 4 Jul 2023 08:05:49 -0400 Subject: [PATCH] Allow for infinite timespan on the Timeout property. --- src/HtmlAgilityPack.Shared/HtmlWeb.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HtmlAgilityPack.Shared/HtmlWeb.cs b/src/HtmlAgilityPack.Shared/HtmlWeb.cs index e1077ca5..f04579c6 100644 --- a/src/HtmlAgilityPack.Shared/HtmlWeb.cs +++ b/src/HtmlAgilityPack.Shared/HtmlWeb.cs @@ -808,7 +808,7 @@ internal static HttpClient GetSharedHttpClient(string userAgent) public int Timeout { get { return _timeout; } - set { if (value <= 0) { throw new ArgumentOutOfRangeException(); } else { _timeout = value; } } + set { if (value <= 0 && value != -1) { throw new ArgumentOutOfRangeException(); } else { _timeout = value; } } } ///