From 950623b95d75b292a3b7a6dea50e8fb1c3ea6581 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 19 Feb 2014 00:25:00 -0500 Subject: [PATCH] strip content length from head request --- .../Progressive/BaseProgressiveStreamingService.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs b/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs index 09b87bce9a..b8decb5068 100644 --- a/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs +++ b/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs @@ -14,6 +14,7 @@ using System.Collections.Generic; using System.IO; using System.Threading; using System.Threading.Tasks; +using ServiceStack.Web; namespace MediaBrowser.Api.Playback.Progressive { @@ -287,7 +288,16 @@ namespace MediaBrowser.Api.Playback.Progressive // Headers only if (isHeadRequest) { - return ResultFactory.GetResult(new byte[] { }, contentType, responseHeaders); + var streamResult = ResultFactory.GetResult(new byte[] { }, contentType, responseHeaders); + var hasOptions = streamResult as IHasOptions; + if (hasOptions != null) + { + if (hasOptions.Options.ContainsKey("Content-Length")) + { + hasOptions.Options.Remove("Content-Length"); + } + } + return streamResult; } if (!File.Exists(outputPath))