fix: add use forwarded headers and clear known
This commit is contained in:
parent
3326b17d74
commit
497b7f146b
@ -84,6 +84,8 @@ public class Program
|
|||||||
|
|
||||||
options.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
|
options.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
|
||||||
options.ForwardedForHeaderName = secretForward.SecretForwardToken + "-X-Forwarded-For";
|
options.ForwardedForHeaderName = secretForward.SecretForwardToken + "-X-Forwarded-For";
|
||||||
|
options.KnownNetworks.Clear();
|
||||||
|
options.KnownProxies.Clear();
|
||||||
});
|
});
|
||||||
|
|
||||||
builder.Services.AddCustomApiVersioning();
|
builder.Services.AddCustomApiVersioning();
|
||||||
@ -94,6 +96,7 @@ public class Program
|
|||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
|
||||||
|
app.UseForwardedHeaders();
|
||||||
app.UseStaticFiles(UrlHelper.GetSubPath.TrimEnd('/'));
|
app.UseStaticFiles(UrlHelper.GetSubPath.TrimEnd('/'));
|
||||||
app.UseCors("AllowAll");
|
app.UseCors("AllowAll");
|
||||||
app.UseCustomSerilog();
|
app.UseCustomSerilog();
|
||||||
|
Loading…
Reference in New Issue
Block a user