aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/HttpServer/BaseRestService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Server.Implementations/HttpServer/BaseRestService.cs')
-rw-r--r--MediaBrowser.Server.Implementations/HttpServer/BaseRestService.cs18
1 files changed, 8 insertions, 10 deletions
diff --git a/MediaBrowser.Server.Implementations/HttpServer/BaseRestService.cs b/MediaBrowser.Server.Implementations/HttpServer/BaseRestService.cs
index ef9483b6e..cdb6adbe7 100644
--- a/MediaBrowser.Server.Implementations/HttpServer/BaseRestService.cs
+++ b/MediaBrowser.Server.Implementations/HttpServer/BaseRestService.cs
@@ -83,7 +83,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer
var key = cacheKey.ToString("N");
- var result = PreProcessCachedResult(cacheKey, key, lastDateModified, cacheDuration, string.Empty);
+ var result = PreProcessCachedResult(cacheKey, key, lastDateModified, cacheDuration);
if (result != null)
{
@@ -117,9 +117,11 @@ namespace MediaBrowser.Server.Implementations.HttpServer
throw new ArgumentNullException("factoryFn");
}
+ Response.ContentType = contentType;
+
var key = cacheKey.ToString("N");
- var result = PreProcessCachedResult(cacheKey, key, lastDateModified, cacheDuration, contentType);
+ var result = PreProcessCachedResult(cacheKey, key, lastDateModified, cacheDuration);
if (result != null)
{
@@ -183,7 +185,9 @@ namespace MediaBrowser.Server.Implementations.HttpServer
var key = cacheKey.ToString("N");
- var result = PreProcessCachedResult(cacheKey, key, lastDateModified, cacheDuration, contentType);
+ Response.ContentType = contentType;
+
+ var result = PreProcessCachedResult(cacheKey, key, lastDateModified, cacheDuration);
if (result != null)
{
@@ -278,9 +282,8 @@ namespace MediaBrowser.Server.Implementations.HttpServer
/// <param name="cacheKeyString">The cache key string.</param>
/// <param name="lastDateModified">The last date modified.</param>
/// <param name="cacheDuration">Duration of the cache.</param>
- /// <param name="contentType">Type of the content.</param>
/// <returns>System.Object.</returns>
- private object PreProcessCachedResult(Guid cacheKey, string cacheKeyString, DateTime? lastDateModified, TimeSpan? cacheDuration, string contentType)
+ private object PreProcessCachedResult(Guid cacheKey, string cacheKeyString, DateTime? lastDateModified, TimeSpan? cacheDuration)
{
Response.AddHeader("ETag", cacheKeyString);
@@ -290,11 +293,6 @@ namespace MediaBrowser.Server.Implementations.HttpServer
AddExpiresHeader(cacheKeyString, cacheDuration);
//ctx.Response.SendChunked = false;
- if (!string.IsNullOrEmpty(contentType))
- {
- Response.ContentType = contentType;
- }
-
Response.StatusCode = 304;
return new byte[]{};