diff --git a/aliyun/api.go b/aliyun/api.go index f4065f2..7c60339 100644 --- a/aliyun/api.go +++ b/aliyun/api.go @@ -92,7 +92,9 @@ func GetFilePath(token string, driveId string, parentFileId string, fileId strin minNum = 1 } for i := len(list.Items); i > minNum; i-- { - path += list.Items[i-1].Name + "/" + if list.Items[i-1].Type == "folder" { + path += list.Items[i-1].Name + "/" + } } cache.GoCache.SetDefault(parentFileId+"path", path) diff --git a/aliyun/model/filepath.go b/aliyun/model/filepath.go index f451d49..4f6f1a2 100644 --- a/aliyun/model/filepath.go +++ b/aliyun/model/filepath.go @@ -2,6 +2,7 @@ package model type FilePath struct { Name string `json:"name,omitempty"` + Type string `json:"type,omitempty"` // created_at: "2021-09-06T07:12:29.103Z" // domain_id: "bj29" // drive_id: "1662258" diff --git a/webdav/webdav.go b/webdav/webdav.go index 9a09797..892883b 100644 --- a/webdav/webdav.go +++ b/webdav/webdav.go @@ -869,6 +869,7 @@ func (h *Handler) handlePropfind(w http.ResponseWriter, r *http.Request) (status href += "/" } } + return mw.write(makePropstatResponse(href, pstats)) } userAgent := r.Header.Get("User-Agent")