Fix 1754
This commit is contained in:
@@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using Elecciones.Database.Entities;
|
||||
using System.Text.Json.Serialization;
|
||||
using Microsoft.AspNetCore.HttpOverrides;
|
||||
|
||||
// Esta es la estructura estándar y recomendada.
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
@@ -69,9 +70,19 @@ builder.Services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddSwaggerGen();
|
||||
|
||||
|
||||
builder.Services.Configure<ForwardedHeadersOptions>(options =>
|
||||
{
|
||||
options.ForwardedHeaders =
|
||||
ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
|
||||
options.KnownNetworks.Clear();
|
||||
options.KnownProxies.Clear();
|
||||
});
|
||||
|
||||
// 3. Construir la aplicación.
|
||||
var app = builder.Build();
|
||||
|
||||
app.UseForwardedHeaders();
|
||||
|
||||
// Seeder para el usuario admin
|
||||
using (var scope = app.Services.CreateScope())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user