|
|
@ -54,11 +54,12 @@ namespace MediaBrowser.Common.Net
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Response.SendChunked = true;
|
|
|
|
|
|
|
|
Response.StatusCode = statusCode;
|
|
|
|
Response.StatusCode = statusCode;
|
|
|
|
|
|
|
|
|
|
|
|
if (statusCode != 304)
|
|
|
|
if (statusCode == 200)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
Response.SendChunked = true;
|
|
|
|
|
|
|
|
|
|
|
|
if (handler.GzipResponse)
|
|
|
|
if (handler.GzipResponse)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Response.AddHeader("Content-Encoding", "gzip");
|
|
|
|
Response.AddHeader("Content-Encoding", "gzip");
|
|
|
@ -72,8 +73,8 @@ namespace MediaBrowser.Common.Net
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Response.OutputStream.Flush();
|
|
|
|
Response.SendChunked = false;
|
|
|
|
Response.OutputStream.Close();
|
|
|
|
Response.OutputStream.Dispose();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -81,7 +82,7 @@ namespace MediaBrowser.Common.Net
|
|
|
|
{
|
|
|
|
{
|
|
|
|
DateTime lastModified = dateModified ?? DateTime.Now;
|
|
|
|
DateTime lastModified = dateModified ?? DateTime.Now;
|
|
|
|
|
|
|
|
|
|
|
|
response.Headers[HttpResponseHeader.CacheControl] = "Public";
|
|
|
|
response.Headers[HttpResponseHeader.CacheControl] = "public, max-age=" + Convert.ToInt32(duration.TotalSeconds);
|
|
|
|
response.Headers[HttpResponseHeader.Expires] = DateTime.Now.Add(duration).ToString("r");
|
|
|
|
response.Headers[HttpResponseHeader.Expires] = DateTime.Now.Add(duration).ToString("r");
|
|
|
|
response.Headers[HttpResponseHeader.LastModified] = lastModified.ToString("r");
|
|
|
|
response.Headers[HttpResponseHeader.LastModified] = lastModified.ToString("r");
|
|
|
|
}
|
|
|
|
}
|
|
|
|