diff --git a/BudgetApp/Program.cs b/BudgetApp/Program.cs index 94df78f..cacf33e 100644 --- a/BudgetApp/Program.cs +++ b/BudgetApp/Program.cs @@ -83,16 +83,16 @@ builder.Services.AddScoped(); builder.Services.AddCascadingAuthenticationState(); // HSTS -if (bool.Parse(Environment.GetEnvironmentVariable("ENABLE_HSTS") ?? "false")) -{ - builder.Services.AddHsts(options => - { - var hstsSection = builder.Configuration.GetSection("Hsts"); - options.MaxAge = TimeSpan.FromDays(hstsSection.GetValue("MaxAgeDays", 365)); - options.IncludeSubDomains = hstsSection.GetValue("IncludeSubDomains", true); - options.Preload = hstsSection.GetValue("Preload", false); - }); -} +//if (bool.Parse(Environment.GetEnvironmentVariable("ENABLE_HSTS") ?? "false")) +//{ +// builder.Services.AddHsts(options => +// { +// var hstsSection = builder.Configuration.GetSection("Hsts"); +// options.MaxAge = TimeSpan.FromDays(hstsSection.GetValue("MaxAgeDays", 365)); +// options.IncludeSubDomains = hstsSection.GetValue("IncludeSubDomains", true); +// options.Preload = hstsSection.GetValue("Preload", false); +// }); +//} // Add services to the container. builder.Services.AddRazorComponents() @@ -112,8 +112,8 @@ if (!app.Environment.IsDevelopment()) { app.UseExceptionHandler("/Error", createScopeForErrors: true); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. - if (bool.Parse(Environment.GetEnvironmentVariable("ENABLE_HSTS") ?? "false")) app.UseHsts(); } + app.UseStatusCodePagesWithReExecute("/not-found"); app.UseHttpsRedirection(); diff --git a/BudgetApp/appsettings.json b/BudgetApp/appsettings.json index 2052c81..264e69b 100644 --- a/BudgetApp/appsettings.json +++ b/BudgetApp/appsettings.json @@ -16,12 +16,6 @@ "Twitter": "", "Mastodon": "" }, - "Hsts": { - "Domain": "nas.oneputleygreen.com", - "MaxAgeDays": 365, - "IncludeSubDomains": true, - "Preload": false - }, "Authentication": { "Google": { "ClientId": "",