mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-04-23 20:49:13 -05:00
[full-ci] skip the file name validation if nodeid used
This commit is contained in:
+10
-7
@@ -412,13 +412,16 @@ func (s *svc) handleSpacesPut(w http.ResponseWriter, r *http.Request, spaceID st
|
||||
return
|
||||
}
|
||||
|
||||
if r.URL.Path != "/" {
|
||||
if err := ValidateName(filepath.Base(ref.Path), s.nameValidators); err != nil {
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
b, err := errors.Marshal(http.StatusBadRequest, err.Error(), "", "")
|
||||
errors.HandleWebdavError(&sublog, w, b, err)
|
||||
return
|
||||
}
|
||||
if ref.GetResourceId().GetOpaqueId() != "" && ref.GetResourceId().GetSpaceId() != ref.GetResourceId().GetOpaqueId() && r.URL.Path == "/" {
|
||||
s.handlePut(ctx, w, r, &ref, sublog)
|
||||
return
|
||||
}
|
||||
|
||||
if err := ValidateName(filename(ref.Path), s.nameValidators); err != nil {
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
b, err := errors.Marshal(http.StatusBadRequest, err.Error(), "", "")
|
||||
errors.HandleWebdavError(&sublog, w, b, err)
|
||||
return
|
||||
}
|
||||
|
||||
s.handlePut(ctx, w, r, &ref, sublog)
|
||||
|
||||
Reference in New Issue
Block a user