Skip to content

Commit

Permalink
Merge pull request #4782 from 2403905/issue-9482-path-copy
Browse files Browse the repository at this point in the history
fixed the response code when copying the shared from to personal via webdav
  • Loading branch information
kobergj authored Jul 30, 2024
2 parents 2d12462 + 9197459 commit d54cae5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions changelog/unreleased/fix-copy-responce-webdav.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Fixed the response code when copying from a share to a personal space

We fixed the response code when copying a file from a share to a personal space with a secure view role.

https://github.com/cs3org/reva/pull/4782
https://github.com/owncloud/ocis/issues/9482
6 changes: 6 additions & 0 deletions internal/http/services/owncloud/ocdav/copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit d54cae5

Please sign in to comment.