fix(server): fixes preflight CORS issue
Build & Deploy / build (push) Successful in 2m55s

This commit is contained in:
2026-07-19 22:35:07 +02:00
parent 8c9c3ce293
commit 0afb5bd371
2 changed files with 9 additions and 2 deletions
+2 -2
View File
@@ -159,6 +159,8 @@ var managementStore = app.Services.GetRequiredService<ManagementStore>();
var tunnelHub = app.Services.GetRequiredService<TunnelHub>();
managementStore.SetConnectedClientProvider(() => tunnelHub.ClientSnapshots.Select(c => c.Id));
app.UseCors();
if (settings.Keycloak.IsConfigured)
{
app.UseAuthentication();
@@ -179,8 +181,6 @@ app.UseAntiforgery();
app.UseElmah();
app.UseCors();
app.Use(async (context, next) =>
{
context.Response.Headers.XFrameOptions = "DENY";
@@ -94,6 +94,13 @@ internal sealed class ServerSettings
private static string[] ReadStringArray(IConfiguration configuration, params string[] keys)
{
var section = configuration.GetSection(keys[0]);
var children = section.GetChildren().ToList();
if (children.Count > 0)
{
return children.Select(c => c.Value!).Where(v => !string.IsNullOrWhiteSpace(v)).ToArray();
}
var value = Read(configuration, keys);
if (string.IsNullOrWhiteSpace(value))
{