From 626fe47bb4dffcb3f34d17ca2e35f254b936b786 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sat, 28 Dec 2024 16:54:30 +0800 Subject: [PATCH] :bug: Fix cannot identify the multipart is completed upload --- pkg/internal/server/api/up_multipart_api.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkg/internal/server/api/up_multipart_api.go b/pkg/internal/server/api/up_multipart_api.go index e7ccfeb..ce2b902 100644 --- a/pkg/internal/server/api/up_multipart_api.go +++ b/pkg/internal/server/api/up_multipart_api.go @@ -113,7 +113,10 @@ func uploadFragmentChunk(c *fiber.Ctx) error { } if !isAllUploaded { - return c.JSON(meta) + return c.JSON(fiber.Map{ + "is_finished": false, + "fragment": meta, + }) } // Merge & post-upload @@ -134,5 +137,8 @@ func uploadFragmentChunk(c *fiber.Ctx) error { services.PublishAnalyzeTask(attachment) } - return c.JSON(meta) + return c.JSON(fiber.Map{ + "is_finished": true, + "attachment": attachment, + }) }