From f48365929eac69b37b97fab859d57c6460d53287 Mon Sep 17 00:00:00 2001 From: Noah Hsu Date: Sat, 10 Sep 2022 13:25:52 +0800 Subject: [PATCH] fix(pikpak): upload empty file (close #1452) --- drivers/pikpak/driver.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/pikpak/driver.go b/drivers/pikpak/driver.go index f0ef12a9355..ffdc16802c9 100644 --- a/drivers/pikpak/driver.go +++ b/drivers/pikpak/driver.go @@ -182,6 +182,10 @@ func (d *PikPak) Put(ctx context.Context, dstDir model.Obj, stream model.FileStr if err != nil { return err } + if stream.GetSize() == 0 { + log.Debugln(string(res)) + return nil + } params := jsoniter.Get(res, "resumable").Get("params") endpoint := params.Get("endpoint").ToString() endpointS := strings.Split(endpoint, ".")