forked from gongxuegit/tiku-backend.net
feat: add runtime logging cors and zlinq foundation
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user