summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI.Web/Startup.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2017-09-22 01:57:18 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2017-09-22 01:57:18 -0400
commit86e55596786f8d65854a75632512750b6e09faae (patch)
tree27f082b50b70f3d3b020855f9ac8b3b1cc5430f6 /src/StardewModdingAPI.Web/Startup.cs
parentef60b8d32abf7c8613749766155d80139e33b9d1 (diff)
downloadSMAPI-86e55596786f8d65854a75632512750b6e09faae.tar.gz
SMAPI-86e55596786f8d65854a75632512750b6e09faae.tar.bz2
SMAPI-86e55596786f8d65854a75632512750b6e09faae.zip
switch mod update endpoint to GET with comma-delimited mod keys (#336)
Diffstat (limited to 'src/StardewModdingAPI.Web/Startup.cs')
-rw-r--r--src/StardewModdingAPI.Web/Startup.cs13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/StardewModdingAPI.Web/Startup.cs b/src/StardewModdingAPI.Web/Startup.cs
index c7a5e8fe..c1f03b34 100644
--- a/src/StardewModdingAPI.Web/Startup.cs
+++ b/src/StardewModdingAPI.Web/Startup.cs
@@ -1,8 +1,11 @@
-using Microsoft.AspNetCore.Builder;
+using System.Linq;
+using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Mvc.ModelBinding.Binders;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
+using StardewModdingAPI.Web.Framework;
namespace StardewModdingAPI.Web
{
@@ -35,7 +38,13 @@ namespace StardewModdingAPI.Web
/// <param name="services">The service injection container.</param>
public void ConfigureServices(IServiceCollection services)
{
- services.AddMvc();
+ services
+ .AddMvc(options =>
+ {
+ // add support for comma-delimited parameters
+ ArrayModelBinderProvider arrayModelBinderProvider = options.ModelBinderProviders.OfType<ArrayModelBinderProvider>().First();
+ options.ModelBinderProviders.Insert(options.ModelBinderProviders.IndexOf(arrayModelBinderProvider), new CommaDelimitedModelBinderProvider());
+ });
}
/// <summary>The method called by the runtime to configure the HTTP request pipeline.</summary>