Skip to content

Commit

Permalink
allow copy on self (needed for cross space copy)
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Richter <crichter@owncloud.com>
  • Loading branch information
dragonchaser committed Mar 18, 2024
1 parent ee015f7 commit bc2b1d8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
1 change: 1 addition & 0 deletions changelog/unreleased/check-parent-on-copy.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Bugfix: Prevent copying a file to a parent folder

When copying a file to a parent folder, the file would be copied to the parent folder, but the file would not be removed from the original folder.

https://github.com/cs3org/reva/pull/4584
https://github.com/cs3org/reva/pull/4582
https://github.com/cs3org/reva/pull/4571
https://github.com/owncloud/ocis/issues/1230
7 changes: 0 additions & 7 deletions internal/http/services/owncloud/ocdav/copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -583,13 +583,6 @@ func (s *svc) prepareCopy(ctx context.Context, w http.ResponseWriter, r *http.Re

}

if srcRef.Path == dstRef.Path {
w.WriteHeader(http.StatusConflict)
b, err := errors.Marshal(http.StatusBadRequest, "source and destination are the same", "")
errors.HandleWebdavError(log, w, b, err)
return nil
}

oh := r.Header.Get(net.HeaderOverwrite)
overwrite, err := net.ParseOverwrite(oh)
if err != nil {
Expand Down

0 comments on commit bc2b1d8

Please sign in to comment.