From 4a9571be4ce65d14656b875d7f0f5ff2e13970d1 Mon Sep 17 00:00:00 2001 From: Roman Perekhod Date: Mon, 29 Jul 2024 16:38:58 +0200 Subject: [PATCH] fixed the response code when copying the shared from to personal via webdav --- changelog/unreleased/fix-copy-responce-webdav.md | 6 ++++++ internal/http/services/owncloud/ocdav/copy.go | 6 ++++++ 2 files changed, 12 insertions(+) create mode 100644 changelog/unreleased/fix-copy-responce-webdav.md diff --git a/changelog/unreleased/fix-copy-responce-webdav.md b/changelog/unreleased/fix-copy-responce-webdav.md new file mode 100644 index 0000000000..8a56e44f3b --- /dev/null +++ b/changelog/unreleased/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) }