Skip to content

Commit 6f9a148

Browse files
authored
Make trashbin restores work again after DAV fixes (#5430)
1 parent a6b6027 commit 6f9a148

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Bugfix: fix trashbin restores
2+
3+
https://github.com/cs3org/reva/pull/5430

internal/http/services/owncloud/ocdav/trashbin.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ func (h *TrashbinHandler) handleTrashbinSpaces(s *svc, w http.ResponseWriter, r
8989
return
9090
}
9191
dst = path.Clean(dst)
92-
_, dst = router.ShiftPath(dst)
9392

9493
log.Debug().Str("key", key).Str("dst", dst).Msg("restore")
9594

@@ -541,7 +540,7 @@ func (h *TrashbinHandler) restore(w http.ResponseWriter, r *http.Request, s *svc
541540
}
542541

543542
dstRef := &provider.Reference{
544-
Path: path.Join(basePath, dst),
543+
Path: dst,
545544
}
546545

547546
dstStatReq := &provider.StatRequest{
@@ -564,7 +563,7 @@ func (h *TrashbinHandler) restore(w http.ResponseWriter, r *http.Request, s *svc
564563
// restore location exists, and if it doesn't returns a conflict error code.
565564
if dstStatRes.Status.Code == rpc.Code_CODE_NOT_FOUND && isNested(dst) {
566565
parentStatReq := &provider.StatRequest{
567-
Ref: &provider.Reference{Path: path.Join(basePath, filepath.Dir(dst))},
566+
Ref: &provider.Reference{Path: filepath.Dir(dst)},
568567
}
569568

570569
parentStatResponse, err := client.Stat(ctx, parentStatReq)

0 commit comments

Comments
 (0)