From 040cfd7a75423d4e6136e58a67b40579af4ee966 Mon Sep 17 00:00:00 2001 From: Jonathan Bourdon Date: Tue, 14 Jan 2025 01:07:47 -0500 Subject: [PATCH] Updates CORS --- src/Web/Program.cs | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/src/Web/Program.cs b/src/Web/Program.cs index 331eed3..1b93b9b 100644 --- a/src/Web/Program.cs +++ b/src/Web/Program.cs @@ -22,28 +22,14 @@ if (!builder.Environment.IsDevelopment()) builder.Services.AddCors(options => { - options.AddPolicy("AllowAll", policy => - { - policy.AllowAnyOrigin() - .AllowAnyMethod() - .AllowAnyHeader(); - }); - - options.AddPolicy("AllowHutopyUi", policy => - { - policy.WithOrigins("https://jolly-stone-078869d0f.5.azurestaticapps.net") - .AllowAnyMethod() - .AllowAnyHeader() - .AllowCredentials(); - }); - - options.AddPolicy("AllowHutopyUiPreview", policy => - { - policy.WithOrigins("https://zealous-bay-08204590f-preview.eastus2.5.azurestaticapps.net") - .AllowAnyMethod() - .AllowAnyHeader() - .AllowCredentials(); - }); + options.AddPolicy( + "AllowAll", + policy => + { + policy.AllowAnyOrigin() + .AllowAnyMethod() + .AllowAnyHeader(); + }); }); // Add services to the container. @@ -106,8 +92,6 @@ app.UseForwardedHeaders( ); app.UseCors("AllowAll"); -app.UseCors("AllowHutopyUi"); -app.UseCors("AllowHutopyUiPreview"); app.UseAuthentication(); app.UseAuthorization();