Added: Platform Detection Improvements

This commit is contained in:
Qstick
2018-04-21 00:59:31 -04:00
parent ea5ad24944
commit aef89160e2
89 changed files with 1311 additions and 535 deletions

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
@@ -31,12 +31,14 @@ namespace NzbDrone.Common.Http
private readonly ICached<CookieContainer> _cookieContainerCache;
private readonly List<IHttpRequestInterceptor> _requestInterceptors;
private readonly IHttpDispatcher _httpDispatcher;
private readonly IUserAgentBuilder _userAgentBuilder;
public HttpClient(IEnumerable<IHttpRequestInterceptor> requestInterceptors, ICacheManager cacheManager, IRateLimitService rateLimitService, IHttpDispatcher httpDispatcher, Logger logger)
public HttpClient(IEnumerable<IHttpRequestInterceptor> requestInterceptors, ICacheManager cacheManager, IRateLimitService rateLimitService, IHttpDispatcher httpDispatcher, IUserAgentBuilder userAgentBuilder, Logger logger)
{
_requestInterceptors = requestInterceptors.ToList();
_rateLimitService = rateLimitService;
_httpDispatcher = httpDispatcher;
_userAgentBuilder = userAgentBuilder;
_logger = logger;
ServicePointManager.DefaultConnectionLimit = 12;
@@ -71,7 +73,7 @@ namespace NzbDrone.Common.Http
while (response.HasHttpRedirect);
}
if (response.HasHttpRedirect && !RuntimeInfoBase.IsProduction)
if (response.HasHttpRedirect && !RuntimeInfo.IsProduction)
{
_logger.Error("Server requested a redirect to [{0}] while in developer mode. Update the request URL to avoid this redirect.", response.Headers["Location"]);
}