[full-ci] fixed the response code when copying the file from the shares to personal space

This commit is contained in:
Roman Perekhod committed 2024-07-24 12:39:13 +02:00
1 parent e15c3c3a04
commit 83c8d32ce9
5 files changed
+16 -4

No files matched your search

@@ -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)
}