diff options
| -rw-r--r-- | MediaBrowser.Common/Net/Handlers/BaseHandler.cs | 16 | ||||
| -rw-r--r-- | MediaBrowser.Common/Net/RequestContext.cs | 7 |
2 files changed, 22 insertions, 1 deletions
diff --git a/MediaBrowser.Common/Net/Handlers/BaseHandler.cs b/MediaBrowser.Common/Net/Handlers/BaseHandler.cs index 16a08b9b3..a63759708 100644 --- a/MediaBrowser.Common/Net/Handlers/BaseHandler.cs +++ b/MediaBrowser.Common/Net/Handlers/BaseHandler.cs @@ -13,6 +13,22 @@ namespace MediaBrowser.Common.Net.Handlers /// </summary>
public IDictionary<string, string> Headers = new Dictionary<string, string>();
+ public virtual bool UseChunkedEncoding
+ {
+ get
+ {
+ return true;
+ }
+ }
+
+ public virtual long? ContentLength
+ {
+ get
+ {
+ return null;
+ }
+ }
+
/// <summary>
/// Returns true or false indicating if the handler writes to the stream asynchronously.
/// If so the subclass will be responsible for disposing the stream when complete.
diff --git a/MediaBrowser.Common/Net/RequestContext.cs b/MediaBrowser.Common/Net/RequestContext.cs index e00dac02a..c95f95eba 100644 --- a/MediaBrowser.Common/Net/RequestContext.cs +++ b/MediaBrowser.Common/Net/RequestContext.cs @@ -58,7 +58,12 @@ namespace MediaBrowser.Common.Net if (statusCode == 200)
{
- Response.SendChunked = true;
+ Response.SendChunked = handler.UseChunkedEncoding;
+
+ if (handler.ContentLength.HasValue)
+ {
+ Response.ContentLength64 = handler.ContentLength.Value;
+ }
if (handler.CompressResponse)
{
|
