Skip to content

The Free Software Media System - Server Backend & API

Merge branch 'master' into httpclient

Bond-009d0fbd260d5cc
diff --cc Emby.Server.Implementations/ApplicationHost.cs
index 2f396f8146,e15cb68e9e..0b4c161fdc
--- a/Emby.Server.Implementations/ApplicationHost.cs
+++ b/Emby.Server.Implementations/ApplicationHost.cs
@@@ -1479,12 -1467,12 +1468,12 @@@ namespace Emby.Server.Implementation
LogErrorResponseBody = false,
LogErrors = false,
LogRequest = false,
- TimeoutMs = 10000,
BufferContent = false,
CancellationToken = cancellationToken
- }))
+ }).ConfigureAwait(false))
{
- return GetLocalApiUrl(response.ReadToEnd().Trim());
+ string res = await response.ReadToEndAsync().ConfigureAwait(false);
+ return GetLocalApiUrl(res.Trim());
}
}
catch (Exception ex)
@@@ -1598,17 -1588,18 +1589,18 @@@
try
{
- using (var response = await HttpClient.SendAsync(new HttpRequestOptions
- {
- Url = apiUrl,
- LogErrorResponseBody = false,
- LogErrors = logPing,
- LogRequest = logPing,
- BufferContent = false,
+ using (var response = await HttpClient.SendAsync(
+ new HttpRequestOptions
+ {
+ Url = apiUrl,
+ LogErrorResponseBody = false,
- LogErrors = LogPing,
- LogRequest = LogPing,
- TimeoutMs = 5000,
++ LogErrors = logPing,
++ LogRequest = logPing,
+ BufferContent = false,
- CancellationToken = cancellationToken
+ CancellationToken = cancellationToken
- }, "POST").ConfigureAwait(false))
+
- }, HttpMethod.Post).ConfigureAwait(false))
++ }, HttpMethod.Post).ConfigureAwait(false))
{
using (var reader = new StreamReader(response.Content))
{