diff options
| author | Claus Vium <clausvium@gmail.com> | 2019-07-19 23:22:30 +0200 |
|---|---|---|
| committer | Claus Vium <clausvium@gmail.com> | 2019-07-19 23:22:30 +0200 |
| commit | 886c88576c04eda76c076d056194afa9140815a7 (patch) | |
| tree | af758d0dd4b2c237349712a98978f5c843272955 /Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs | |
| parent | cf2f5b2026b4b46b43bd57ef1b17dcb6a0a23270 (diff) | |
Use HttpCompletionOption.ResponseHeadersRead and resort to Content-Length header for non-buffered content
Diffstat (limited to 'Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs')
| -rw-r--r-- | Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs b/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs index 2752e9324..a4cd98b40 100644 --- a/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs +++ b/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs @@ -284,7 +284,7 @@ namespace Emby.Server.Implementations.HttpClientManager if (!options.BufferContent) { - var response = await client.SendAsync(httpWebRequest, options.CancellationToken).ConfigureAwait(false); + var response = await client.SendAsync(httpWebRequest, HttpCompletionOption.ResponseHeadersRead, options.CancellationToken).ConfigureAwait(false); await EnsureSuccessStatusCode(response, options).ConfigureAwait(false); @@ -296,7 +296,7 @@ namespace Emby.Server.Implementations.HttpClientManager Content = stream, StatusCode = response.StatusCode, ContentType = response.Content.Headers.ContentType?.MediaType, - ContentLength = stream.Length, + ContentLength = response.Content.Headers.ContentLength, ResponseUrl = response.Content.Headers.ContentLocation?.ToString() }; } |
