aboutsummaryrefslogtreecommitdiff
path: root/Emby.Dlna/PlayTo/SsdpHttpClient.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Dlna/PlayTo/SsdpHttpClient.cs')
-rw-r--r--Emby.Dlna/PlayTo/SsdpHttpClient.cs7
1 files changed, 3 insertions, 4 deletions
diff --git a/Emby.Dlna/PlayTo/SsdpHttpClient.cs b/Emby.Dlna/PlayTo/SsdpHttpClient.cs
index c8c36fc972..557bc69a73 100644
--- a/Emby.Dlna/PlayTo/SsdpHttpClient.cs
+++ b/Emby.Dlna/PlayTo/SsdpHttpClient.cs
@@ -4,7 +4,6 @@ using System;
using System.Globalization;
using System.IO;
using System.Net.Http;
-using System.Net.Http.Headers;
using System.Net.Mime;
using System.Text;
using System.Threading;
@@ -45,7 +44,7 @@ namespace Emby.Dlna.PlayTo
header,
cancellationToken)
.ConfigureAwait(false);
- await using var stream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false);
+ await using var stream = await response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);
using var reader = new StreamReader(stream, Encoding.UTF8);
return XDocument.Parse(
await reader.ReadToEndAsync().ConfigureAwait(false),
@@ -60,7 +59,7 @@ namespace Emby.Dlna.PlayTo
return serviceUrl;
}
- if (!serviceUrl.StartsWith("/", StringComparison.Ordinal))
+ if (!serviceUrl.StartsWith('/'))
{
serviceUrl = "/" + serviceUrl;
}
@@ -94,7 +93,7 @@ namespace Emby.Dlna.PlayTo
options.Headers.UserAgent.ParseAdd(USERAGENT);
options.Headers.TryAddWithoutValidation("FriendlyName.DLNA.ORG", FriendlyName);
using var response = await _httpClientFactory.CreateClient(NamedClient.Default).SendAsync(options, HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
- await using var stream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false);
+ await using var stream = await response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);
using var reader = new StreamReader(stream, Encoding.UTF8);
return XDocument.Parse(
await reader.ReadToEndAsync().ConfigureAwait(false),