webdav: move WebDAV semantics handling to LocalFileSystem

This commit is contained in:
Simon Ser
2020-01-21 21:49:54 +01:00
parent 04bcea1ee8
commit a2ad695145
2 changed files with 9 additions and 7 deletions

View File

@@ -66,6 +66,13 @@ func (fs LocalFileSystem) RemoveAll(name string) error {
if err != nil {
return err
}
// WebDAV semantics are that it should return a "404 Not Found" error in
// case the resource doesn't exist. We need to Stat before RemoveAll.
if _, err = os.Stat(p); err != nil {
return err
}
return os.RemoveAll(p)
}