diff options
Diffstat (limited to 'src/SMAPI.Web/Startup.cs')
-rw-r--r-- | src/SMAPI.Web/Startup.cs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/SMAPI.Web/Startup.cs b/src/SMAPI.Web/Startup.cs index 0f656e55..b27ff9a5 100644 --- a/src/SMAPI.Web/Startup.cs +++ b/src/SMAPI.Web/Startup.cs @@ -66,6 +66,13 @@ namespace StardewModdingAPI.Web loggerFactory.AddDebug(); app .UseRewriter(new RewriteOptions() + // redirect to HTTPS (except API for Linux/Mac Mono compatibility) + .Add(new ConditionalRedirectToHttpsRule( + shouldRewrite: req => + req.Host.Host != "localhost" + && !req.Path.StartsWithSegments("/api") + )) + // convert subdomain.smapi.io => smapi.io/subdomain for routing .Add(new ConditionalRewriteSubdomainRule( shouldRewrite: req => |