Skip to content

Commit 404f48d

Browse files
another test
1 parent 20db8fe commit 404f48d

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

EssentialCSharp.Web/Program.cs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ private static void Main(string[] args)
2323
{
2424
options.ForwardedHeaders =
2525
ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
26+
27+
// Only loopback proxies are allowed by default.
28+
// Clear that restriction because forwarders are enabled by explicit
29+
// configuration.
30+
options.KnownNetworks.Clear();
31+
options.KnownProxies.Clear();
2632
});
2733

2834
ConfigurationManager configuration = builder.Configuration;
@@ -161,15 +167,7 @@ private static void Main(string[] args)
161167
{
162168
app.UseDeveloperExceptionPage();
163169
app.UseForwardedHeaders();
164-
}
165-
166-
//app.Use((context, next) =>
167-
//{
168-
// context.Request.Scheme = "https";
169-
// return next(context);
170-
//});
171-
172-
170+
}
173171

174172
app.MapHealthChecks("/healthz");
175173

0 commit comments

Comments
 (0)