strip content length from head request

This commit is contained in:
Luke Pulverenti 2014-02-19 00:25:00 -05:00
parent e8ac0a988d
commit 950623b95d

View File

@ -14,6 +14,7 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using ServiceStack.Web;
namespace MediaBrowser.Api.Playback.Progressive namespace MediaBrowser.Api.Playback.Progressive
{ {
@ -287,7 +288,16 @@ namespace MediaBrowser.Api.Playback.Progressive
// Headers only // Headers only
if (isHeadRequest) 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)) if (!File.Exists(outputPath))