Skip to content
This repository has been archived by the owner on Oct 17, 2022. It is now read-only.

Commit

Permalink
webdav.go: change list to local scope variable
Browse files Browse the repository at this point in the history
api.go: add marker post data whenever available
  • Loading branch information
topcheer committed Dec 17, 2021
1 parent 27e7067 commit 103298e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions aliyun/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion webdav/webdav.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down

0 comments on commit 103298e

Please sign in to comment.