chore(display): cleaner file download handling (#30)

This commit is contained in:
2026-01-19 21:48:09 +01:00
committed by GitHub
parent 203e48c31c
commit f2a648b429
+1 -8
View File
@@ -295,14 +295,7 @@ func downloadFileRoute(ctx echo.Context) error {
slog.Info("Serving file for download", "path", fullPath)
file, err := os.Open(fullPath)
if err != nil {
slog.Error("Failed to open file", "file", fullPath, "error", err)
return ctx.JSON(http.StatusInternalServerError, shared.ErrorResponse{Description: "Failed to open file"})
}
defer file.Close()
return ctx.Stream(http.StatusOK, "application/octet-stream", file)
return ctx.File(fullPath)
}
func openFileRoute(ctx echo.Context) error {