feat: add runtime logging cors and zlinq foundation

This commit is contained in:
xiong
2026-07-26 13:39:06 +08:00
parent f0553a7919
commit f4783c5de3
10 changed files with 340 additions and 104 deletions

View File

@@ -95,6 +95,21 @@ public sealed class TenantPublicEndpointTests
Assert.Equal("ok", body.GetProperty("status").GetString());
}
[Fact]
public async Task Cors_preflight_allows_configured_development_origin()
{
await using var factory = new ApiTestFactory();
using var client = factory.CreateClient();
using var request = new HttpRequestMessage(HttpMethod.Options, "/api/health");
request.Headers.Add("Origin", "http://localhost:5173");
request.Headers.Add("Access-Control-Request-Method", "GET");
var response = await client.SendAsync(request);
Assert.Equal(HttpStatusCode.NoContent, response.StatusCode);
Assert.Equal("http://localhost:5173", response.Headers.GetValues("Access-Control-Allow-Origin").Single());
}
private static Task SeedTenantAsync(ApiTestFactory factory, Guid tenantId)
{
return factory.SeedAsync(