diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-02-24 15:21:37 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-02-24 15:21:37 -0500 |
| commit | a73eeac6869edc199c4d0915d07b6847d0c95524 (patch) | |
| tree | 378241f264bbd6106ea6e958e5bf346d1f76b86e /Emby.Server.Implementations/HttpServer/HttpResultFactory.cs | |
| parent | c456490de43082f008dd592345e76cf75db1ad0a (diff) | |
| parent | cd6b7f3bdc5bcbc6c68131cc40b71b68ac1b73a6 (diff) | |
Merge branch 'master' of https://github.com/MediaBrowser/Emby
Diffstat (limited to 'Emby.Server.Implementations/HttpServer/HttpResultFactory.cs')
| -rw-r--r-- | Emby.Server.Implementations/HttpServer/HttpResultFactory.cs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs b/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs index e78446bc8..6bfd83110 100644 --- a/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs +++ b/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs @@ -13,10 +13,9 @@ using System.Text; using System.Threading.Tasks; using System.Xml; using Emby.Server.Implementations.HttpServer; +using Emby.Server.Implementations.Services; using MediaBrowser.Model.IO; using MediaBrowser.Model.Services; -using ServiceStack; -using ServiceStack.Host; using IRequest = MediaBrowser.Model.Services.IRequest; using MimeTypes = MediaBrowser.Model.Net.MimeTypes; using StreamWriter = Emby.Server.Implementations.HttpServer.StreamWriter; @@ -203,7 +202,11 @@ namespace Emby.Server.Implementations.HttpServer // Do not use the memoryStreamFactory here, they don't place nice with compression using (var ms = new MemoryStream()) { - ContentTypes.Instance.SerializeToStream(request, dto, ms); + var contentType = request.ResponseContentType; + var writerFn = RequestHelper.GetResponseWriter(HttpListenerHost.Instance, contentType); + + writerFn(dto, ms); + ms.Position = 0; var responseHeaders = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); |
