From 30bcc662bcc555ba3463a71f29a2fe7470d4c1f3 Mon Sep 17 00:00:00 2001 From: Taloth Saldono Date: Mon, 21 Sep 2015 23:22:34 +0200 Subject: [PATCH] Fixed composition. --- src/NzbDrone.Common/Composition/Container.cs | 1 + src/NzbDrone.Common/Http/HttpClient.cs | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Common/Composition/Container.cs b/src/NzbDrone.Common/Composition/Container.cs index a52ad0dc7..55a56bee2 100644 --- a/src/NzbDrone.Common/Composition/Container.cs +++ b/src/NzbDrone.Common/Composition/Container.cs @@ -54,6 +54,7 @@ namespace NzbDrone.Common.Composition var factory = CreateSingletonImplementationFactory(implementation); _container.Register(service, factory); + _container.Register(service, factory, implementation.FullName); } public IEnumerable ResolveAll() where T : class diff --git a/src/NzbDrone.Common/Http/HttpClient.cs b/src/NzbDrone.Common/Http/HttpClient.cs index c05805af5..a757261da 100644 --- a/src/NzbDrone.Common/Http/HttpClient.cs +++ b/src/NzbDrone.Common/Http/HttpClient.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO; +using System.Linq; using System.Net; using NLog; using NzbDrone.Common.Cache; @@ -28,13 +29,13 @@ namespace NzbDrone.Common.Http private readonly IRateLimitService _rateLimitService; private readonly ICached _cookieContainerCache; private readonly ICached _curlTLSFallbackCache; - private readonly IEnumerable _requestInterceptors; + private readonly List _requestInterceptors; public HttpClient(IEnumerable requestInterceptors, ICacheManager cacheManager, IRateLimitService rateLimitService, Logger logger) { _logger = logger; _rateLimitService = rateLimitService; - _requestInterceptors = requestInterceptors; + _requestInterceptors = requestInterceptors.ToList(); ServicePointManager.DefaultConnectionLimit = 12; _cookieContainerCache = cacheManager.GetCache(typeof(HttpClient));