diff --git a/changelog/changelog/fix-copy-responce-webdav.md b/changelog/changelog/fix-copy-responce-webdav.md new file mode 100644 index 0000000000..8a56e44f3b --- /dev/null +++ b/changelog/changelog/fix-copy-responce-webdav.md @@ -0,0 +1,6 @@ +Bugfix: Fixed the response code when copying the shared from to personal + +We fixed the response code when copying the file from shares to personal space with a secure view role. + +https://github.com/cs3org/reva/pull/4782 +https://github.com/owncloud/ocis/issues/9482 diff --git a/internal/http/services/owncloud/ocdav/copy.go b/internal/http/services/owncloud/ocdav/copy.go index e575bdda76..c009e59789 100644 --- a/internal/http/services/owncloud/ocdav/copy.go +++ b/internal/http/services/owncloud/ocdav/copy.go @@ -292,6 +292,12 @@ func (s *svc) executePathCopy(ctx context.Context, selector pool.Selectable[gate return err } defer httpDownloadRes.Body.Close() + if httpDownloadRes.StatusCode == http.StatusForbidden { + w.WriteHeader(http.StatusForbidden) + b, err := errors.Marshal(http.StatusForbidden, http.StatusText(http.StatusForbidden), "", strconv.Itoa(http.StatusForbidden)) + errors.HandleWebdavError(log, w, b, err) + return nil + } if httpDownloadRes.StatusCode != http.StatusOK { return fmt.Errorf("status code %d", httpDownloadRes.StatusCode) }