This commit is contained in:
@@ -2,6 +2,7 @@ using Gotenberg.Sharp.API.Client;
|
||||
using Gotenberg.Sharp.API.Client.Domain.Settings;
|
||||
using Gotenberg.Sharp.API.Client.Extensions;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.HttpOverrides;
|
||||
using Microsoft.AspNetCore.Mvc.Authorization;
|
||||
using Microsoft.Identity.Web;
|
||||
using Microsoft.Identity.Web.UI;
|
||||
@@ -19,6 +20,12 @@ builder.Services.AddControllersWithViews(options =>
|
||||
.Build();
|
||||
options.Filters.Add(new AuthorizeFilter(policy));
|
||||
}).AddMicrosoftIdentityUI().AddDataAnnotationsLocalization();
|
||||
builder.Services.Configure<ForwardedHeadersOptions>(options =>
|
||||
{
|
||||
options.KnownNetworks.Clear();
|
||||
options.KnownProxies.Clear();
|
||||
options.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
|
||||
});
|
||||
// Add services to the container.
|
||||
builder.Services.AddRazorComponents()
|
||||
.AddInteractiveServerComponents();
|
||||
@@ -41,6 +48,7 @@ if (!app.Environment.IsDevelopment())
|
||||
app.UseStaticFiles();
|
||||
app.UseAntiforgery();
|
||||
app.MapControllers();
|
||||
app.UseForwardedHeaders();
|
||||
|
||||
app.MapRazorComponents<App>();
|
||||
// .AddInteractiveServerRenderMode();
|
||||
|
||||
Reference in New Issue
Block a user