fix: harden webdav directory copies

This commit is contained in:
OpenClaw Agent
2026-09-22 00:55:29 +08:00
parent a7b111234d
commit 098d79c253
2 changed files with 57 additions and 16 deletions
+1 -1
View File
@@ -153,7 +153,7 @@ func TestWebDAVStorageFSCopyFailureDoesNotCorruptDestination(t *testing.T) {
if err := os.WriteFile(filepath.Join(root, "dst.txt"), []byte("original"), 0o644); err != nil {
t.Fatal(err)
}
if err := copyFileToDestination(store, failingReader{}, "dst.txt", true); err == nil {
if err := copyFileToDestination(store, failingReader{}, "dst.txt"); err == nil {
t.Fatal("expected source read failure")
}
got, err := os.ReadFile(filepath.Join(root, "dst.txt"))