adapt test for #514 (#2255)

This commit is contained in:
Viktor Scharf
2026-02-03 19:51:33 +01:00
committed by GitHub
parent 0639304e96
commit 400dc9f8ae
30 changed files with 939 additions and 621 deletions
@@ -97,6 +97,10 @@ func (s *svc) handleSpacesMkCol(w http.ResponseWriter, r *http.Request, spaceID
sublog := appctx.GetLogger(ctx).With().Str("path", r.URL.Path).Str("spaceid", spaceID).Str("handler", "mkcol").Logger()
if err := ValidateName(filename(r.URL.Path), s.nameValidators); err != nil {
return http.StatusBadRequest, err
}
parentRef, err := spacelookup.MakeStorageSpaceReference(spaceID, path.Dir(r.URL.Path))
if err != nil {
return http.StatusBadRequest, fmt.Errorf("invalid space id")
@@ -131,6 +131,16 @@ func (s *svc) handleSpacesMove(w http.ResponseWriter, r *http.Request, srcSpaceI
dstSpaceID, dstRelPath := router.ShiftPath(dst)
if dstRelPath != "" && dstRelPath != "." && dstRelPath != "/" {
err := ValidateDestination(filename(dstRelPath), s.nameValidators)
if err != nil {
w.WriteHeader(http.StatusBadRequest)
b, err := errors.Marshal(http.StatusBadRequest, "destination naming rules", "", "")
errors.HandleWebdavError(appctx.GetLogger(ctx), w, b, err)
return
}
}
dstRef, err := spacelookup.MakeStorageSpaceReference(dstSpaceID, dstRelPath)
if err != nil {
w.WriteHeader(http.StatusBadRequest)