diff --git a/src/Startup.cs b/src/Startup.cs index 0f8dfef..7a98d35 100644 --- a/src/Startup.cs +++ b/src/Startup.cs @@ -11,6 +11,7 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using IdentityServer4.Services; +using Microsoft.AspNetCore.HttpOverrides; using SteamOpenIdConnectProvider.Database; using SteamOpenIdConnectProvider.Profile; @@ -97,6 +98,16 @@ namespace SteamOpenIdConnectProvider await next(); }); + var forwardOptions = new ForwardedHeadersOptions + { + ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto, + RequireHeaderSymmetry = false + }; + + forwardOptions.KnownNetworks.Clear(); + forwardOptions.KnownProxies.Clear(); + + app.UseForwardedHeaders(forwardOptions); app.UseRouting(); app.UseIdentityServer(); app.UseEndpoints(endpoints =>