aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs')
-rw-r--r--MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs20
1 files changed, 20 insertions, 0 deletions
diff --git a/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs b/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs
index a5b241b4b..a49a0a0db 100644
--- a/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs
+++ b/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs
@@ -276,6 +276,26 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
{
options.CancellationToken.ThrowIfCancellationRequested();
+ if (!options.BufferContent)
+ {
+ var response = await httpWebRequest.GetResponseAsync().ConfigureAwait(false);
+
+ var httpResponse = (HttpWebResponse)response;
+
+ EnsureSuccessStatusCode(httpResponse);
+
+ options.CancellationToken.ThrowIfCancellationRequested();
+
+ return new HttpResponseInfo
+ {
+ Content = httpResponse.GetResponseStream(),
+
+ StatusCode = httpResponse.StatusCode,
+
+ ContentType = httpResponse.ContentType
+ };
+ }
+
using (var response = await httpWebRequest.GetResponseAsync().ConfigureAwait(false))
{
var httpResponse = (HttpWebResponse)response;