Skip to content

The Free Software Media System - Server Backend & API

Add HttpCompletionOption.ResponseHeadersRead to the buffering option to avoid potentially having 2 copies in memory

Claus Viumdadfc09c01ee
diff --git a/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs b/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs
index a4cd98b400..528053c21b 100644
--- a/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs
+++ b/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs
@@ -301,7 +301,7 @@ namespace Emby.Server.Implementations.HttpClientManager
};
}
- using (var response = await client.SendAsync(httpWebRequest, options.CancellationToken).ConfigureAwait(false))
+ using (var response = await client.SendAsync(httpWebRequest, HttpCompletionOption.ResponseHeadersRead, options.CancellationToken).ConfigureAwait(false))
{
await EnsureSuccessStatusCode(response, options).ConfigureAwait(false);