test fixes and new product advisories work
This commit is contained in:
@@ -542,6 +542,9 @@ app.MapConcelierMirrorEndpoints(authorityConfigured, enforceAuthority);
|
||||
app.MapCanonicalAdvisoryEndpoints();
|
||||
app.MapInterestScoreEndpoints();
|
||||
|
||||
// Federation endpoints for site-to-site bundle sync
|
||||
app.MapConcelierFederationEndpoints();
|
||||
|
||||
app.MapGet("/.well-known/openapi", ([FromServices] OpenApiDiscoveryDocumentProvider provider, HttpContext context) =>
|
||||
{
|
||||
var (payload, etag) = provider.GetDocument();
|
||||
@@ -3750,8 +3753,12 @@ var concelierTimelineEndpoint = app.MapGet("/obs/concelier/timeline", async (
|
||||
}
|
||||
|
||||
var logger = loggerFactory.CreateLogger("ConcelierTimeline");
|
||||
|
||||
// Compute next cursor BEFORE writing any response content (headers must be set before body)
|
||||
var nextCursor = startId + take;
|
||||
context.Response.Headers.CacheControl = "no-store";
|
||||
context.Response.Headers["X-Accel-Buffering"] = "no";
|
||||
context.Response.Headers["X-Next-Cursor"] = nextCursor.ToString(CultureInfo.InvariantCulture);
|
||||
context.Response.ContentType = "text/event-stream";
|
||||
|
||||
// SSE retry hint (5s) to encourage clients to reconnect with cursor
|
||||
@@ -3784,8 +3791,6 @@ var concelierTimelineEndpoint = app.MapGet("/obs/concelier/timeline", async (
|
||||
|
||||
await context.Response.Body.FlushAsync(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
var nextCursor = startId + events.Count;
|
||||
context.Response.Headers["X-Next-Cursor"] = nextCursor.ToString(CultureInfo.InvariantCulture);
|
||||
logger.LogInformation("obs timeline emitted {Count} events for tenant {Tenant} starting at {StartId} next {Next}", events.Count, tenant, startId, nextCursor);
|
||||
|
||||
return HttpResults.Empty;
|
||||
|
||||
Reference in New Issue
Block a user