From 103298ec0a2705d41bd839d91d494c6847aac618 Mon Sep 17 00:00:00 2001 From: Junjun Zhang Date: Fri, 17 Dec 2021 10:17:45 +0800 Subject: [PATCH] webdav.go: change list to local scope variable api.go: add marker post data whenever available --- aliyun/api.go | 4 ++++ webdav/webdav.go | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/aliyun/api.go b/aliyun/api.go index b33fcf6..0671403 100644 --- a/aliyun/api.go +++ b/aliyun/api.go @@ -41,6 +41,10 @@ func GetList(token string, driveId string, parentFileId string, marker ...string postData["fields"] = "*" postData["order_by"] = "updated_at" postData["order_direction"] = "DESC" + //add marker post data + if len(marker) > 0 { + postData["marker"] = marker[0] + } data, err := json.Marshal(postData) if err != nil { diff --git a/webdav/webdav.go b/webdav/webdav.go index 69736bb..85c9088 100644 --- a/webdav/webdav.go +++ b/webdav/webdav.go @@ -779,7 +779,8 @@ func (h *Handler) handlePropfind(w http.ResponseWriter, r *http.Request) (status if len(list.Items) == 0 { fi = aliyun.GetFileDetail(h.Config.Token, h.Config.DriveId, value) } else { - list, err = aliyun.GetList(h.Config.Token, h.Config.DriveId, "") + //bugfix: use new local scope variable + list, _ := aliyun.GetList(h.Config.Token, h.Config.DriveId, "") fi, _ = findUrl(strArr, h.Config.Token, h.Config.DriveId, list) } }