Fix 1754
This commit is contained in:
		| @@ -2,7 +2,7 @@ | |||||||
| import axios from 'axios'; | import axios from 'axios'; | ||||||
| import type { ProyeccionBancas, MunicipioSimple, TelegramaData, CatalogoItem, CategoriaResumen, ResultadoTicker, ApiResponseResultadosPorSeccion } from './types/types'; | import type { ProyeccionBancas, MunicipioSimple, TelegramaData, CatalogoItem, CategoriaResumen, ResultadoTicker, ApiResponseResultadosPorSeccion } from './types/types'; | ||||||
|  |  | ||||||
| const API_BASE_URL = 'http://localhost:5217/api'; | const API_BASE_URL = '/api'; | ||||||
|  |  | ||||||
| const apiClient = axios.create({ | const apiClient = axios.create({ | ||||||
|   baseURL: API_BASE_URL, |   baseURL: API_BASE_URL, | ||||||
|   | |||||||
| @@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Authentication.JwtBearer; | |||||||
| using Microsoft.IdentityModel.Tokens; | using Microsoft.IdentityModel.Tokens; | ||||||
| using Elecciones.Database.Entities; | using Elecciones.Database.Entities; | ||||||
| using System.Text.Json.Serialization; | using System.Text.Json.Serialization; | ||||||
|  | using Microsoft.AspNetCore.HttpOverrides; | ||||||
|  |  | ||||||
| // Esta es la estructura estándar y recomendada. | // Esta es la estructura estándar y recomendada. | ||||||
| var builder = WebApplication.CreateBuilder(args); | var builder = WebApplication.CreateBuilder(args); | ||||||
| @@ -69,9 +70,19 @@ builder.Services.AddEndpointsApiExplorer(); | |||||||
| builder.Services.AddSwaggerGen(); | 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. | // 3. Construir la aplicación. | ||||||
| var app = builder.Build(); | var app = builder.Build(); | ||||||
|  |  | ||||||
|  | app.UseForwardedHeaders(); | ||||||
|  |  | ||||||
| // Seeder para el usuario admin | // Seeder para el usuario admin | ||||||
| using (var scope = app.Services.CreateScope()) | using (var scope = app.Services.CreateScope()) | ||||||
| { | { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user