aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs')
-rw-r--r--MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs21
1 files changed, 10 insertions, 11 deletions
diff --git a/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs b/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs
index 0d03e7985..09b87bce9 100644
--- a/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs
+++ b/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs
@@ -9,7 +9,6 @@ using MediaBrowser.Controller.MediaInfo;
using MediaBrowser.Controller.Persistence;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.IO;
-using ServiceStack.Web;
using System;
using System.Collections.Generic;
using System.IO;
@@ -241,6 +240,13 @@ namespace MediaBrowser.Api.Playback.Progressive
responseHeaders["Accept-Ranges"] = "none";
+ var length = response.Headers["Content-Length"];
+
+ if (!string.IsNullOrEmpty(length))
+ {
+ responseHeaders["Content-Length"] = length;
+ }
+
if (isHeadRequest)
{
using (response.Content)
@@ -274,20 +280,14 @@ namespace MediaBrowser.Api.Playback.Progressive
// Use the command line args with a dummy playlist path
var outputPath = GetOutputFilePath(state);
+ responseHeaders["Accept-Ranges"] = "none";
+
var contentType = MimeTypes.GetMimeType(outputPath);
// Headers only
if (isHeadRequest)
{
- responseHeaders["Accept-Ranges"] = "none";
-
- var value = ResultFactory.GetResult(new byte[]{}, contentType, responseHeaders);
- if (value as IHasOptions != null)
- {
- if (((IHasOptions)value).Options.ContainsKey("Content-Length"))
- ((IHasOptions)value).Options.Remove("Content-Length");
- }
- return value;
+ return ResultFactory.GetResult(new byte[] { }, contentType, responseHeaders);
}
if (!File.Exists(outputPath))
@@ -301,7 +301,6 @@ namespace MediaBrowser.Api.Playback.Progressive
var result = new ProgressiveStreamWriter(outputPath, Logger, FileSystem);
- result.Options["Accept-Ranges"] = "none";
result.Options["Content-Type"] = contentType;
// Add the response headers to the result object