File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed
Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff 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 ( ) ;
You can’t perform that action at this time.
0 commit comments