From d421ff973692a35d55e3773b2dc82e0a0d717546 Mon Sep 17 00:00:00 2001 From: Taloth Saldono Date: Tue, 24 Dec 2019 11:27:39 +0100 Subject: [PATCH] Increased max redirects from 3 to 5 closes #3449 --- src/NzbDrone.Common/Http/HttpClient.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Common/Http/HttpClient.cs b/src/NzbDrone.Common/Http/HttpClient.cs index 99327ee76..61d509e6a 100644 --- a/src/NzbDrone.Common/Http/HttpClient.cs +++ b/src/NzbDrone.Common/Http/HttpClient.cs @@ -26,6 +26,8 @@ namespace NzbDrone.Common.Http public class HttpClient : IHttpClient { + private const int MaxRedirects = 5; + private readonly Logger _logger; private readonly IRateLimitService _rateLimitService; private readonly ICached _cookieContainerCache; @@ -68,7 +70,7 @@ namespace NzbDrone.Common.Http _logger.Trace("Redirected to {0}", request.Url); - if (autoRedirectChain.Count > 3) + if (autoRedirectChain.Count > MaxRedirects) { throw new WebException($"Too many automatic redirections were attempted for {autoRedirectChain.Join(" -> ")}", WebExceptionStatus.ProtocolError); }