diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-12-04 09:52:38 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-12-04 09:52:38 -0500 |
| commit | 4e79eaf65e8edb895f9337a8b878ff9ef312b3f6 (patch) | |
| tree | ae9f74aad256236ada5203fae1f1640867d13360 /MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs | |
| parent | 40959a816f49d040e16e0178d0e11d51282d98cc (diff) | |
add ApplicationPath to app paths interface to hide implementation
Diffstat (limited to 'MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs b/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs index e6942fae6..5a5a2dd04 100644 --- a/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs +++ b/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs @@ -99,6 +99,14 @@ namespace MediaBrowser.Server.Implementations.HttpServer return result; } + private bool SupportsCompression + { + get + { + return true; + } + } + /// <summary> /// Gets the optimized result. /// </summary> @@ -116,7 +124,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer throw new ArgumentNullException("result"); } - var optimizedResult = requestContext.ToOptimizedResult(result); + var optimizedResult = SupportsCompression ? requestContext.ToOptimizedResult(result) : result; if (responseHeaders != null) { @@ -458,6 +466,11 @@ namespace MediaBrowser.Server.Implementations.HttpServer } } + if (!SupportsCompression) + { + return new HttpResult(content, contentType); + } + var contents = content.Compress(requestContext.CompressionType); return new CompressedResult(contents, requestContext.CompressionType, contentType); |
