diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-02-28 00:22:36 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-02-28 00:22:36 -0500 |
| commit | fb51f1e6f012f0832e089b94a075b20089fed555 (patch) | |
| tree | c7830d0293635850ff8d90e65009e4cb5df21e9b /MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs | |
| parent | c177de940766f3f3aa228e789003185bf388c200 (diff) | |
refined app themes
Diffstat (limited to 'MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs b/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs index 4c21d2eb7..8455d9f58 100644 --- a/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs +++ b/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs @@ -238,8 +238,19 @@ namespace MediaBrowser.Server.Implementations.HttpServer return hasOptions; } - // Otherwise wrap into an HttpResult - var httpResult = new HttpResult(result, contentType ?? "text/html", HttpStatusCode.NotModified); + IHasOptions httpResult; + + var stream = result as Stream; + + if (stream != null) + { + httpResult = new StreamWriter(stream, contentType, _logger); + } + else + { + // Otherwise wrap into an HttpResult + httpResult = new HttpResult(result, contentType ?? "text/html", HttpStatusCode.NotModified); + } AddResponseHeaders(httpResult, responseHeaders); @@ -478,7 +489,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer if (!SupportsCompression) { responseHeaders["Content-Length"] = originalContentLength.ToString(UsCulture); - + if (isHeadRequest) { return GetHttpResult(new byte[] { }, contentType); @@ -495,7 +506,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer { return GetHttpResult(new byte[] { }, contentType); } - + return new CompressedResult(contents, requestedCompressionType, contentType); } |
