From 1ef86305c1e713ba0332687b9f5e34346b8ef855 Mon Sep 17 00:00:00 2001 From: foxxorcat Date: Fri, 8 Mar 2024 23:08:30 +0800 Subject: [PATCH] fix(mopan):upload error (close #6158) --- drivers/mopan/driver.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mopan/driver.go b/drivers/mopan/driver.go index b5441bff2ea..369ec83b64d 100644 --- a/drivers/mopan/driver.go +++ b/drivers/mopan/driver.go @@ -295,7 +295,7 @@ func (d *MoPan) Put(ctx context.Context, dstDir model.Obj, stream model.FileStre } if !initUpdload.FileDataExists { - utils.Log.Error(d.client.CloudDiskStartBusiness()) + // utils.Log.Error(d.client.CloudDiskStartBusiness()) threadG, upCtx := errgroup.NewGroupWithContext(ctx, d.uploadThread, retry.Attempts(3), @@ -323,6 +323,7 @@ func (d *MoPan) Put(ctx context.Context, dstDir model.Obj, stream model.FileStre if err != nil { return err } + req.ContentLength = byteSize resp, err := base.HttpClient.Do(req) if err != nil { return err