Добавил фикс заголовков
All checks were successful
Create and publish a Docker image / Publish image (push) Successful in 2m18s
All checks were successful
Create and publish a Docker image / Publish image (push) Successful in 2m18s
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
using Microsoft.AspNetCore.HttpOverrides;
|
||||||
using Microsoft.Identity.Web;
|
using Microsoft.Identity.Web;
|
||||||
using Scalar.AspNetCore;
|
using Scalar.AspNetCore;
|
||||||
using SfeduSchedule.Services;
|
using SfeduSchedule.Services;
|
||||||
@@ -17,6 +18,11 @@ builder.Services.AddOpenApi();
|
|||||||
builder.Services.AddControllers();
|
builder.Services.AddControllers();
|
||||||
builder.Services.AddHttpClient<ModeusService>();
|
builder.Services.AddHttpClient<ModeusService>();
|
||||||
|
|
||||||
|
builder.Services.Configure<ForwardedHeadersOptions>(options =>
|
||||||
|
{
|
||||||
|
options.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
|
||||||
|
});
|
||||||
|
|
||||||
builder.Services.AddMicrosoftIdentityWebAppAuthentication(builder.Configuration);
|
builder.Services.AddMicrosoftIdentityWebAppAuthentication(builder.Configuration);
|
||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
@@ -28,6 +34,7 @@ app.MapScalarApiReference(options =>
|
|||||||
options.Theme = ScalarTheme.Kepler;
|
options.Theme = ScalarTheme.Kepler;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
app.UseForwardedHeaders();
|
||||||
app.UseAuthorization();
|
app.UseAuthorization();
|
||||||
|
|
||||||
app.MapControllers();
|
app.MapControllers();
|
||||||
|
Reference in New Issue
Block a user