Skip to content

Commit

Permalink
Merge pull request #4 from Teddy55Codes/develop
Browse files Browse the repository at this point in the history
FIX CORS FOR NOW; AND FOREVER:*
  • Loading branch information
Teddy55Codes authored Oct 19, 2024
2 parents f82cbaa + e823911 commit 473fe1b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/SelfExtendingBackend/SelfExtendingBackend.Backend/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
{
policy.AllowAnyOrigin()
.AllowAnyMethod()
.AllowAnyHeader();
.AllowAnyHeader()
.SetIsOriginAllowed(_ => true) // Allows requests from any origin
.WithExposedHeaders("Access-Control-Allow-Origin")
.WithExposedHeaders("Access-Control-Allow-Methods");
});
});

Expand All @@ -35,11 +38,8 @@

var app = builder.Build();

// Enable CORS globally
app.UseCors("AllowAll");

app.UseCors("AllowAll"); // Enable CORS first
app.UseResponseCompression();

app.UseRouting();

// List to store all dynamically registered endpoints
Expand Down

0 comments on commit 473fe1b

Please sign in to comment.