fix: metadata mismatch if file name contains % while uploading to OneDrive/SharePoint (#1301)

This commit is contained in:
HFO4
2022-10-08 19:09:51 +08:00
parent 644a326580
commit f431eb0cbd
3 changed files with 12 additions and 33 deletions

View File

@@ -37,19 +37,13 @@ const (
// GetSourcePath 获取文件的绝对路径
func (info *FileInfo) GetSourcePath() string {
res, err := url.PathUnescape(
strings.TrimPrefix(
path.Join(
strings.TrimPrefix(info.ParentReference.Path, "/drive/root:"),
info.Name,
),
"/",
return strings.TrimPrefix(
path.Join(
strings.TrimPrefix(info.ParentReference.Path, "/drive/root:"),
info.Name,
),
"/",
)
if err != nil {
return ""
}
return res
}
// Error 实现error接口