浏览代码

Removes Content-Lenght header for HEAD requests

This is done to be able to support transcoding for DLNA devices.
7illusions 11 年之前
父节点
当前提交
4a795f96a1
共有 1 个文件被更改,包括 8 次插入1 次删除
  1. 8 1
      MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs

+ 8 - 1
MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs

@@ -9,6 +9,7 @@ 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;
@@ -280,7 +281,13 @@ namespace MediaBrowser.Api.Playback.Progressive
             {
                 responseHeaders["Accept-Ranges"] = "none";
 
-                return ResultFactory.GetResult(new byte[] { }, contentType, responseHeaders);
+                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;
             }
 
             if (!File.Exists(outputPath))