diff --git a/src/Program.cs b/src/Program.cs index 83b0802..46bcaa7 100644 --- a/src/Program.cs +++ b/src/Program.cs @@ -178,11 +178,12 @@ private static void ConfigureMiddleware(IApplicationBuilder app) }); } - app.UseHttpsRedirection(); + app.UseStaticFiles(); - app.UseHsts(); - if (IsProduction()) + if (!UseHttp()) { + app.UseHttpsRedirection(); + app.UseHsts(); app.UseExceptionHandler("/Error"); app.UseMiddleware(); } @@ -247,7 +248,7 @@ private static async void BootstrapElectron() } private static bool UseHttp() - => _env.Equals(CashTrackEnv.Development, StringComparison.CurrentCultureIgnoreCase) || _env.Equals(CashTrackEnv.Docker, StringComparison.CurrentCultureIgnoreCase); + => _env.Equals(CashTrackEnv.Electron, StringComparison.CurrentCultureIgnoreCase) || _env.Equals(CashTrackEnv.Docker, StringComparison.CurrentCultureIgnoreCase); private static bool IsProduction() => _env.Equals(CashTrackEnv.Production, StringComparison.CurrentCultureIgnoreCase); private static bool IsDocker()