aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2017-02-24 15:21:11 -0500
committerGitHub <noreply@github.com>2017-02-24 15:21:11 -0500
commitcd6b7f3bdc5bcbc6c68131cc40b71b68ac1b73a6 (patch)
tree48b8f6d94e3f762a486aa1c4fa6937cf23c18dee /Emby.Server.Implementations/HttpServer/HttpResultFactory.cs
parentc07e774ca9c0f234ec6899e17fc70301d1990290 (diff)
parent66a844e6399f1d79be8e10ea098ba6768e0d123b (diff)
Merge pull request #2489 from MediaBrowser/beta
Beta
Diffstat (limited to 'Emby.Server.Implementations/HttpServer/HttpResultFactory.cs')
-rw-r--r--Emby.Server.Implementations/HttpServer/HttpResultFactory.cs9
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);