aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Formatters/XmlOutputFormatter.cs
diff options
context:
space:
mode:
authorJPVenson <github@jpb.email>2025-02-02 02:09:14 +0000
committerJPVenson <github@jpb.email>2025-02-02 02:09:14 +0000
commit17003f4d76c7c5e80c5b4d20ba19ade84803fea1 (patch)
tree50d159016418a0e068c917f6d013b0b44cdf146b /Jellyfin.Api/Formatters/XmlOutputFormatter.cs
parentebe89c07b39702a3b8205d2070d95a5f79d3b1d2 (diff)
parentce64dbc034b2176d863fb598cf7079aa6a1fce55 (diff)
Merge remote-tracking branch 'jellyfinorigin/master' into feature/pgsql_provider
Diffstat (limited to 'Jellyfin.Api/Formatters/XmlOutputFormatter.cs')
-rw-r--r--Jellyfin.Api/Formatters/XmlOutputFormatter.cs15
1 files changed, 1 insertions, 14 deletions
diff --git a/Jellyfin.Api/Formatters/XmlOutputFormatter.cs b/Jellyfin.Api/Formatters/XmlOutputFormatter.cs
index 1c9feedcb..8dbb91d0a 100644
--- a/Jellyfin.Api/Formatters/XmlOutputFormatter.cs
+++ b/Jellyfin.Api/Formatters/XmlOutputFormatter.cs
@@ -1,7 +1,4 @@
using System.Net.Mime;
-using System.Text;
-using System.Threading.Tasks;
-using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.Formatters;
namespace Jellyfin.Api.Formatters;
@@ -9,7 +6,7 @@ namespace Jellyfin.Api.Formatters;
/// <summary>
/// Xml output formatter.
/// </summary>
-public class XmlOutputFormatter : TextOutputFormatter
+public sealed class XmlOutputFormatter : StringOutputFormatter
{
/// <summary>
/// Initializes a new instance of the <see cref="XmlOutputFormatter"/> class.
@@ -18,15 +15,5 @@ public class XmlOutputFormatter : TextOutputFormatter
{
SupportedMediaTypes.Clear();
SupportedMediaTypes.Add(MediaTypeNames.Text.Xml);
-
- SupportedEncodings.Add(Encoding.UTF8);
- SupportedEncodings.Add(Encoding.Unicode);
- }
-
- /// <inheritdoc />
- public override Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding)
- {
- var stringResponse = context.Object?.ToString();
- return stringResponse is null ? Task.CompletedTask : context.HttpContext.Response.WriteAsync(stringResponse);
}
}