From d1568c788ad76bf909d5f34066e79fecbd0a8800 Mon Sep 17 00:00:00 2001 From: steinhelge Date: Wed, 26 Nov 2025 12:07:31 +0100 Subject: [PATCH] config: Allow all origins in CORS policy and disable HTTPS redirection. --- src/Hospitality.Backend/Program.cs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/Hospitality.Backend/Program.cs b/src/Hospitality.Backend/Program.cs index 6b45e09..89632c9 100644 --- a/src/Hospitality.Backend/Program.cs +++ b/src/Hospitality.Backend/Program.cs @@ -65,16 +65,9 @@ builder.Services.AddScoped(); // Add CORS builder.Services.AddCors(options => { - options.AddPolicy("AllowFrontend", policy => - { - policy.WithOrigins( - "http://localhost:5173", - "https://hospitality-dev.theriise.net", - "https://hospitality.theriise.net" - ) - .AllowAnyHeader() - .AllowAnyMethod(); - }); + policy.SetIsOriginAllowed(origin => true) // Allow any origin + .AllowAnyHeader() + .AllowAnyMethod(); }); @@ -101,7 +94,7 @@ if (app.Environment.IsDevelopment()) app.UseSwaggerUI(); } -app.UseHttpsRedirection(); +// app.UseHttpsRedirection(); // Disabled because Traefik handles SSL app.UseCors("AllowFrontend");