aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/ApplicationHost.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Server.Implementations/ApplicationHost.cs')
-rw-r--r--Emby.Server.Implementations/ApplicationHost.cs15
1 files changed, 6 insertions, 9 deletions
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs
index 3aa2dbf9a..120aade39 100644
--- a/Emby.Server.Implementations/ApplicationHost.cs
+++ b/Emby.Server.Implementations/ApplicationHost.cs
@@ -420,7 +420,7 @@ namespace Emby.Server.Implementations
/// Gets the current application user agent
/// </summary>
/// <value>The application user agent.</value>
- public string ApplicationUserAgent => Name.Replace(' ','-') + "/" + ApplicationVersion;
+ public string ApplicationUserAgent => Name.Replace(' ','-') + '/' + ApplicationVersion;
/// <summary>
/// Gets the email address for use within a comment section of a user agent field.
@@ -678,11 +678,6 @@ namespace Emby.Server.Implementations
await HttpServer.RequestHandler(req, request.GetDisplayUrl(), request.Host.ToString(), localPath, CancellationToken.None).ConfigureAwait(false);
}
- protected virtual IHttpClient CreateHttpClient()
- {
- return new HttpClientManager.HttpClientManager(ApplicationPaths, LoggerFactory, FileSystemManager, () => ApplicationUserAgent);
- }
-
public static IStreamHelper StreamHelper { get; set; }
/// <summary>
@@ -708,7 +703,11 @@ namespace Emby.Server.Implementations
serviceCollection.AddSingleton(FileSystemManager);
serviceCollection.AddSingleton<TvDbClientManager>();
- HttpClient = CreateHttpClient();
+ HttpClient = new HttpClientManager.HttpClientManager(
+ ApplicationPaths,
+ LoggerFactory.CreateLogger<HttpClientManager.HttpClientManager>(),
+ FileSystemManager,
+ () => ApplicationUserAgent);
serviceCollection.AddSingleton(HttpClient);
serviceCollection.AddSingleton(NetworkManager);
@@ -1690,9 +1689,7 @@ namespace Emby.Server.Implementations
LogErrors = LogPing,
LogRequest = LogPing,
BufferContent = false,
-
CancellationToken = cancellationToken
-
}, HttpMethod.Post).ConfigureAwait(false))
{
using (var reader = new StreamReader(response.Content))