38 lines
963 B
C#
38 lines
963 B
C#
using Kurisu.AspNetCore.Startup;
|
|
using Microsoft.AspNetCore.HttpOverrides;
|
|
using Microsoft.IdentityModel.Logging;
|
|
|
|
class Program
|
|
{
|
|
static void Main(string[] args)
|
|
{
|
|
KurisuHost.Run<Startup>(args);
|
|
}
|
|
}
|
|
|
|
public class Startup : DefaultStartup
|
|
{
|
|
public Startup(IConfiguration configuration) : base(configuration)
|
|
{
|
|
IdentityModelEventSource.ShowPII = true;
|
|
}
|
|
|
|
public override void ConfigureServices(IServiceCollection services)
|
|
{
|
|
base.ConfigureServices(services);
|
|
services.AddHttpContextAccessor();
|
|
services.Configure<ForwardedHeadersOptions>(options =>
|
|
{
|
|
options.ForwardedHeaders = ForwardedHeaders.All;
|
|
|
|
options.KnownNetworks.Clear();
|
|
options.KnownProxies.Clear();
|
|
});
|
|
}
|
|
|
|
public override void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
|
{
|
|
app.UseForwardedHeaders();
|
|
base.Configure(app, env);
|
|
}
|
|
} |