diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2023-01-29 16:37:22 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2023-01-29 16:37:22 -0500 |
commit | 5c22406c13ef4933a5e17e9036d9fd3ca9b9a9a7 (patch) | |
tree | 7a5c4600825d6494d505acf24a14501f35ec84a4 /src/SMAPI.Web/Framework/Clients | |
parent | e5576d9c925210c83ba9f123c2ced86377ece560 (diff) | |
download | SMAPI-5c22406c13ef4933a5e17e9036d9fd3ca9b9a9a7.tar.gz SMAPI-5c22406c13ef4933a5e17e9036d9fd3ca9b9a9a7.tar.bz2 SMAPI-5c22406c13ef4933a5e17e9036d9fd3ca9b9a9a7.zip |
adjust JSON formatter instead of adding a new one
Diffstat (limited to 'src/SMAPI.Web/Framework/Clients')
-rw-r--r-- | src/SMAPI.Web/Framework/Clients/UpdateManifest/TextAsJsonMediaTypeFormatter.cs | 19 | ||||
-rw-r--r-- | src/SMAPI.Web/Framework/Clients/UpdateManifest/UpdateManifestClient.cs | 4 |
2 files changed, 3 insertions, 20 deletions
diff --git a/src/SMAPI.Web/Framework/Clients/UpdateManifest/TextAsJsonMediaTypeFormatter.cs b/src/SMAPI.Web/Framework/Clients/UpdateManifest/TextAsJsonMediaTypeFormatter.cs deleted file mode 100644 index 02722cb1..00000000 --- a/src/SMAPI.Web/Framework/Clients/UpdateManifest/TextAsJsonMediaTypeFormatter.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2022 Jamie Taylor -using System.Net.Http.Formatting; -using System.Net.Http.Headers; - -namespace StardewModdingAPI.Web.Framework.Clients.UpdateManifest -{ - /// <summary>A <see cref="JsonMediaTypeFormatter"/> that can parse from content of type <c>text/plain</c>.</summary> - internal class TextAsJsonMediaTypeFormatter : JsonMediaTypeFormatter - { - /********* - ** Public methods - *********/ - /// <summary>Construct a new <see cref="JsonMediaTypeFormatter"/></summary> - public TextAsJsonMediaTypeFormatter() - { - this.SupportedMediaTypes.Add(new MediaTypeHeaderValue("text/plain")); - } - } -} diff --git a/src/SMAPI.Web/Framework/Clients/UpdateManifest/UpdateManifestClient.cs b/src/SMAPI.Web/Framework/Clients/UpdateManifest/UpdateManifestClient.cs index 88a5c2f6..0199027f 100644 --- a/src/SMAPI.Web/Framework/Clients/UpdateManifest/UpdateManifestClient.cs +++ b/src/SMAPI.Web/Framework/Clients/UpdateManifest/UpdateManifestClient.cs @@ -1,5 +1,6 @@ // Copyright 2022 Jamie Taylor using System.Net; +using System.Net.Http.Headers; using System.Threading.Tasks; using Pathoschild.Http.Client; using StardewModdingAPI.Toolkit.Framework.UpdateData; @@ -32,7 +33,8 @@ namespace StardewModdingAPI.Web.Framework.Clients.UpdateManifest { this.Client = new FluentClient() .SetUserAgent(userAgent); - this.Client.Formatters.Add(new TextAsJsonMediaTypeFormatter()); + + this.Client.Formatters.JsonFormatter.SupportedMediaTypes.Add(new MediaTypeHeaderValue("text/plain")); } /// <summary>Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.</summary> |