aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Services/RequestHelper.cs
diff options
context:
space:
mode:
authorPatrick Barron <18354464+barronpm@users.noreply.github.com>2020-09-03 15:57:16 +0000
committerGitHub <noreply@github.com>2020-09-03 15:57:16 +0000
commit15135dc3b8a2421b6b4d550fa5e141e064d5bf82 (patch)
treeaaf94c0c43ae32eea429319ee700be8ba0f9ab4c /Emby.Server.Implementations/Services/RequestHelper.cs
parent602e746af058daf317fd8a92b2538619d00d6414 (diff)
parent0712a7ef11c24c2aa51bbfa74dfa311af24c90bb (diff)
Merge branch 'master' into jellyfin-data-warnings
Diffstat (limited to 'Emby.Server.Implementations/Services/RequestHelper.cs')
-rw-r--r--Emby.Server.Implementations/Services/RequestHelper.cs51
1 files changed, 0 insertions, 51 deletions
diff --git a/Emby.Server.Implementations/Services/RequestHelper.cs b/Emby.Server.Implementations/Services/RequestHelper.cs
deleted file mode 100644
index 1f9c7fc22..000000000
--- a/Emby.Server.Implementations/Services/RequestHelper.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-#pragma warning disable CS1591
-
-using System;
-using System.IO;
-using System.Threading.Tasks;
-using Emby.Server.Implementations.HttpServer;
-
-namespace Emby.Server.Implementations.Services
-{
- public class RequestHelper
- {
- public static Func<Type, Stream, Task<object>> GetRequestReader(HttpListenerHost host, string contentType)
- {
- switch (GetContentTypeWithoutEncoding(contentType))
- {
- case "application/xml":
- case "text/xml":
- case "text/xml; charset=utf-8": //"text/xml; charset=utf-8" also matches xml
- return host.DeserializeXml;
-
- case "application/json":
- case "text/json":
- return host.DeserializeJson;
- }
-
- return null;
- }
-
- public static Action<object, Stream> GetResponseWriter(HttpListenerHost host, string contentType)
- {
- switch (GetContentTypeWithoutEncoding(contentType))
- {
- case "application/xml":
- case "text/xml":
- case "text/xml; charset=utf-8": //"text/xml; charset=utf-8" also matches xml
- return host.SerializeToXml;
-
- case "application/json":
- case "text/json":
- return host.SerializeToJson;
- }
-
- return null;
- }
-
- private static string GetContentTypeWithoutEncoding(string contentType)
- {
- return contentType?.Split(';')[0].ToLowerInvariant().Trim();
- }
- }
-}