merge: deterministic sync tests and a current-log download that survives new lines

This commit is contained in:
Claude committed 2026-10-06 22:22:47 +00:00
commit 01f301f970
5 files changed
+175 -27

No files matched your search

+4 -3
View File
@@ -29,10 +29,11 @@ public static class AdminEndpoints
ProtocolJson.Default.ListLogFileDto));
logs.MapGet("/files/{name}", (HttpContext context, string name, ServerOptions options) =>
{
// Only names of existing log files are served: the name never becomes part of a path.
// Only names of existing log files are served: the name never becomes part of a path. The current log keeps
// growing while it is sent, so the response holds the bytes it had when listed, as its Content-Length says.
if (LogFiles(options).FirstOrDefault(f => f.Name == name) is not { } file) return ApiErrors.NotFound(context, "log");
context.Response.Headers.CacheControl = "no-store";
return Results.File(file.FullName, "text/plain; charset=utf-8", file.Name, file.LastWriteTimeUtc, enableRangeProcessing: true);
return FileResponses.Serve(context, file, 0, file.Length, "text/plain; charset=utf-8", "no-store", downloadName: file.Name)
?? ApiErrors.NotFound(context, "log");
});
}