mirror of
https://github.com/rclone/rclone.git
synced 2024-12-23 15:38:57 +01:00
webdav: if root ends with / then don't check if it is a file
This commit is contained in:
parent
e7ae5e8ee0
commit
a29a1de43d
@ -258,6 +258,7 @@ func NewFs(name, root string) (fs.Fs, error) {
|
|||||||
if !strings.HasSuffix(endpoint, "/") {
|
if !strings.HasSuffix(endpoint, "/") {
|
||||||
endpoint += "/"
|
endpoint += "/"
|
||||||
}
|
}
|
||||||
|
rootIsDir := strings.HasSuffix(root, "/")
|
||||||
root = strings.Trim(root, "/")
|
root = strings.Trim(root, "/")
|
||||||
|
|
||||||
user := config.FileGet(name, "user")
|
user := config.FileGet(name, "user")
|
||||||
@ -297,7 +298,7 @@ func NewFs(name, root string) (fs.Fs, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if root != "" {
|
if root != "" && !rootIsDir {
|
||||||
// Check to see if the root actually an existing file
|
// Check to see if the root actually an existing file
|
||||||
remote := path.Base(root)
|
remote := path.Base(root)
|
||||||
f.root = path.Dir(root)
|
f.root = path.Dir(root)
|
||||||
|
Loading…
Reference in New Issue
Block a user