From 8a2b779d0c59ab80ab6476ab28e838c69ab6c99a Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 1 Nov 2017 16:47:23 -0400 Subject: add CORS policy for *.smapi.io (#358) --- src/SMAPI.Web/Startup.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/SMAPI.Web/Startup.cs b/src/SMAPI.Web/Startup.cs index bc491128..0ea9f7ee 100644 --- a/src/SMAPI.Web/Startup.cs +++ b/src/SMAPI.Web/Startup.cs @@ -64,6 +64,12 @@ namespace StardewModdingAPI.Web loggerFactory.AddConsole(this.Configuration.GetSection("Logging")); loggerFactory.AddDebug(); app + .UseCors(policy => policy + .AllowAnyHeader() + .AllowAnyMethod() + .WithOrigins("https://smapi.io", "https://*.smapi.io", "https://*.edge.smapi.io") + .SetIsOriginAllowedToAllowWildcardSubdomains() + ) .UseRewriter(new RewriteOptions() // redirect to HTTPS (except API for Linux/Mac Mono compatibility) .Add(new ConditionalRedirectToHttpsRule( -- cgit