From 34cc4eee9d35b5afa3116292a4f38f1703d42cae Mon Sep 17 00:00:00 2001 From: LukePulverenti Date: Fri, 8 Mar 2013 16:06:02 -0500 Subject: more updates for api docs --- .../HttpServer/BaseRestService.cs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'MediaBrowser.Server.Implementations/HttpServer/BaseRestService.cs') 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 /// The cache key string. /// The last date modified. /// Duration of the cache. - /// Type of the content. /// System.Object. - 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[]{}; -- cgit v1.2.3