From bacb791ba9a3954855162523a79ef521cb0c5083 Mon Sep 17 00:00:00 2001 From: Simon Maddocks Date: Sun, 3 Oct 2021 03:11:40 +0100 Subject: [PATCH] :`( --- ManagementPage/ManagementPage/Program.cs | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/ManagementPage/ManagementPage/Program.cs b/ManagementPage/ManagementPage/Program.cs index 0306a43..76d7c2c 100644 --- a/ManagementPage/ManagementPage/Program.cs +++ b/ManagementPage/ManagementPage/Program.cs @@ -8,13 +8,6 @@ using Microsoft.Extensions.Configuration; var builder = WebApplication.CreateBuilder(args); var Configuration = builder.Configuration; -builder.Services.Configure(options => -{ - options.RequireHeaderSymmetry = false; - options.ForwardedHeaders = - ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto; -}); - // Add services to the container. builder.Services.AddRazorPages(); builder.Services.AddControllers(); @@ -38,6 +31,11 @@ builder.Services.AddAuthentication(options => { var app = builder.Build(); +app.UseForwardedHeaders(new ForwardedHeadersOptions +{ + RequireHeaderSymmetry = false, + ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto +}); // Configure the HTTP request pipeline. @@ -52,18 +50,10 @@ app.UseStaticFiles(); app.UseAuthentication(); -app.UseForwardedHeaders(); - app.UseRouting(); app.UseAuthorization(); -app.UseForwardedHeaders(new ForwardedHeadersOptions -{ - RequireHeaderSymmetry = false, - ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto -}); - app.MapRazorPages(); app.Run();