fix: improve file listing and path handling in Webdav storage
This commit is contained in:
@@ -129,9 +129,12 @@ func (w *Webdav) ListFiles(ctx context.Context, dirPath string) ([]storagetypes.
|
||||
|
||||
isDir := resp.Propstat.Prop.ResourceType.IsCollection()
|
||||
|
||||
filePath := strings.TrimPrefix(decodedHref, path.Join("/", strings.Trim(path.Dir(fullPath), "/")))
|
||||
filePath = strings.TrimPrefix(filePath, "/")
|
||||
|
||||
fileInfo := storagetypes.FileInfo{
|
||||
Name: name,
|
||||
Path: strings.TrimPrefix(decodedHref, w.config.BasePath),
|
||||
Path: path.Join(dirPath, name),
|
||||
Size: resp.Propstat.Prop.GetContentLength,
|
||||
IsDir: isDir,
|
||||
ModTime: modTime,
|
||||
|
||||
Reference in New Issue
Block a user