diff options
| author | Joshua M. Boniface <joshua@boniface.me> | 2019-07-06 17:48:48 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-06 17:48:48 -0400 |
| commit | 3b49c1bac01d73eb3f3d6620370d266d23026790 (patch) | |
| tree | 3be5cf1a79180c57a5381e26f60d61088a27b49e /Emby.Server.Implementations/ApplicationHost.cs | |
| parent | ba551b48e1e1c80192e10b1bb340d974c6b6dee2 (diff) | |
| parent | 82f041d050f998d20818efff063b6000dfcbf5d2 (diff) | |
Merge pull request #1515 from jellyfin/release-10.3.z
Backmerge for 10.3.6
Diffstat (limited to 'Emby.Server.Implementations/ApplicationHost.cs')
| -rw-r--r-- | Emby.Server.Implementations/ApplicationHost.cs | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 3aa2dbf9a6..120aade392 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)) |
