fix: align CHFS files invalid-path response

This commit is contained in:
OpenClaw Agent
2026-09-21 20:39:53 +08:00
parent 556b15a4c3
commit bf98df490c
+3 -1
View File
@@ -177,7 +177,9 @@ func (s *Server) files(w http.ResponseWriter, r *http.Request) {
}
list, e := s.Store.List(p)
if e != nil {
http.Error(w, e.Error(), 404)
// CHFS treats a non-directory / nonexistent filepath as a malformed
// files request rather than exposing the filesystem error.
writeJSONError(w, http.StatusBadRequest, "invalid parameter")
return
}
out := make([]fileInfo, 0, len(list))