refactor: route WebDAV through storage backend

This commit is contained in:
OpenClaw Agent
2026-09-21 17:27:54 +08:00
parent 09b808042d
commit a7192fd96e
3 changed files with 230 additions and 6 deletions
+19
View File
@@ -41,6 +41,25 @@ func NewMulti(paths []string) Multi {
func (m Multi) isVirtualRoot(p string) bool { return strings.Trim(p, "/") == "" }
func (m Multi) FindRoot(p string) (string, string, bool) {
p = strings.Trim(strings.ReplaceAll(p, "\\", "/"), "/")
if p == "" {
return "", "", false
}
parts := strings.SplitN(p, "/", 2)
for _, n := range m.Names {
if parts[0] != n {
continue
}
rel := ""
if len(parts) == 2 {
rel = parts[1]
}
return n, rel, true
}
return "", "", false
}
func (m Multi) find(p string) (Local, string, bool) {
p = strings.Trim(strings.ReplaceAll(p, "\\", "/"), "/")
if p == "" {