projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
18870: Need to declare NODES as array
[arvados.git]
/
services
/
keep-web
/
webdav.go
diff --git
a/services/keep-web/webdav.go
b/services/keep-web/webdav.go
index 3e62b19bbe296f35a514543121d3b29111133db1..501c355a7388a53fe3b40fc3f082c63768665620 100644
(file)
--- a/
services/keep-web/webdav.go
+++ b/
services/keep-web/webdav.go
@@
-2,7
+2,7
@@
//
// SPDX-License-Identifier: AGPL-3.0
//
// SPDX-License-Identifier: AGPL-3.0
-package
main
+package
keepweb
import (
"crypto/rand"
import (
"crypto/rand"
@@
-16,7
+16,7
@@
import (
"sync/atomic"
"time"
"sync/atomic"
"time"
- "git.
curoverse.com
/arvados.git/sdk/go/arvados"
+ "git.
arvados.org
/arvados.git/sdk/go/arvados"
"golang.org/x/net/context"
"golang.org/x/net/webdav"
"golang.org/x/net/context"
"golang.org/x/net/webdav"
@@
-50,7
+50,7
@@
func (fs *webdavFS) makeparents(name string) {
if !fs.writing {
return
}
if !fs.writing {
return
}
- dir,
name
:= path.Split(name)
+ dir,
_
:= path.Split(name)
if dir == "" || dir == "/" {
return
}
if dir == "" || dir == "/" {
return
}
@@
-100,6
+100,11
@@
func (fs *webdavFS) Rename(ctx context.Context, oldName, newName string) error {
if !fs.writing {
return errReadOnly
}
if !fs.writing {
return errReadOnly
}
+ if strings.HasSuffix(oldName, "/") {
+ // WebDAV "MOVE foo/ bar/" means rename foo to bar.
+ oldName = oldName[:len(oldName)-1]
+ newName = strings.TrimSuffix(newName, "/")
+ }
fs.makeparents(newName)
return fs.collfs.Rename(oldName, newName)
}
fs.makeparents(newName)
return fs.collfs.Rename(oldName, newName)
}