Skip to content

Commit e96833d

Browse files
another test
1 parent 20db8fe commit e96833d

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

EssentialCSharp.Web/Program.cs

Lines changed: 7 additions & 10 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

@@ -186,7 +184,6 @@ private static void Main(string[] args)
186184
app.MapRazorPages();
187185
app.MapDefaultControllerRoute();
188186

189-
190187
app.MapFallbackToController("Index", "Home");
191188

192189
app.Run();

0 commit comments

Comments
 (0)