diff --git a/src/NzbDrone.Common/Http/HttpClient.cs b/src/NzbDrone.Common/Http/HttpClient.cs index 3cf6b1d0d..3df89fb63 100644 --- a/src/NzbDrone.Common/Http/HttpClient.cs +++ b/src/NzbDrone.Common/Http/HttpClient.cs @@ -27,6 +27,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; @@ -66,7 +68,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); }