Skip to content

Commit

Permalink
return 403 if copy forbiden
Browse files Browse the repository at this point in the history
  • Loading branch information
2403905 committed Jul 23, 2024
1 parent 1a6e7f6 commit 84d6846
Showing 1 changed file with 6 additions and 0 deletions.
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 @@ -511,6 +511,12 @@ func (s *svc) executeSpacesCopy(ctx context.Context, w http.ResponseWriter, sele
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 84d6846

Please sign in to comment.