diff --git a/Groceries/Program.cs b/Groceries/Program.cs index a799385..10d5c60 100644 --- a/Groceries/Program.cs +++ b/Groceries/Program.cs @@ -34,6 +34,13 @@ if (!dbUpgradeResult.Successful) return -1; } +builder.Services.Configure(options => +{ + options.ForwardedHeaders = ForwardedHeaders.All; + options.KnownNetworks.Clear(); + options.KnownProxies.Clear(); +}); + var dataProtection = builder.Services.AddDataProtection(); if (env.IsProduction()) { @@ -86,7 +93,7 @@ builder.Services.AddDbContextPool(options => options var app = builder.Build(); -app.UseForwardedHeaders(new() { ForwardedHeaders = ForwardedHeaders.All }); +app.UseForwardedHeaders(); app.UseStaticFiles(); app.UseRouting();