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

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

View File

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