mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-05-07 20:15:31 -05:00
Generated
Vendored
+4
@@ -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")
|
||||
|
||||
Generated
Vendored
+10
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user