For small files, just return an Ok result without anything

This commit is contained in:
Jeff Leung 2024-08-21 10:55:58 -07:00
parent 39a418b729
commit 785f503426
1 changed files with 2 additions and 2 deletions

View File

@ -55,10 +55,10 @@ app.MapGet("/api/v1/config", (HttpRequest request) =>
return Results.Json(config, AppJsonSerializerContext.Default); return Results.Json(config, AppJsonSerializerContext.Default);
}); });
app.MapGet("/api/v1/small", (HttpResponse response) => app.MapGet("/api/v1/small", (HttpResponse response, ILogger<Program> logger) =>
{ {
response.ContentType = "application/octet-stream"; response.ContentType = "application/octet-stream";
return Results.File(new byte[] { 0 }); return Results.Ok();
}); });
app.MapGet("/api/v1/large", async (HttpRequest request, HttpResponse response, ILogger<Program> logger) => app.MapGet("/api/v1/large", async (HttpRequest request, HttpResponse response, ILogger<Program> logger) =>