Create HttpProxySettingsProvider and fixed related issues.

This commit is contained in:
Taloth Saldono 2016-04-24 16:20:45 +02:00
parent f807e44a39
commit 9e7927acec
14 changed files with 199 additions and 137 deletions

View file

@ -35,21 +35,15 @@ namespace NzbDrone.Common.Http
public HttpClient(IEnumerable<IHttpRequestInterceptor> requestInterceptors, ICacheManager cacheManager, IRateLimitService rateLimitService, IHttpDispatcher httpDispatcher, Logger logger)
{
_logger = logger;
_rateLimitService = rateLimitService;
_requestInterceptors = requestInterceptors.ToList();
ServicePointManager.DefaultConnectionLimit = 12;
_rateLimitService = rateLimitService;
_httpDispatcher = httpDispatcher;
_logger = logger;
ServicePointManager.DefaultConnectionLimit = 12;
_cookieContainerCache = cacheManager.GetCache<CookieContainer>(typeof(HttpClient));
}
public HttpClient(IEnumerable<IHttpRequestInterceptor> requestInterceptors, ICacheManager cacheManager, IRateLimitService rateLimitService, Logger logger)
: this(requestInterceptors, cacheManager, rateLimitService, null, logger)
{
_httpDispatcher = new FallbackHttpDispatcher(cacheManager.GetCache<bool>(typeof(HttpClient), "curlTLSFallback"), _logger);
}
public HttpResponse Execute(HttpRequest request)
{
foreach (var interceptor in _requestInterceptors)