fix: align CHFS files invalid-path response
This commit is contained in:
@@ -177,7 +177,9 @@ func (s *Server) files(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
list, e := s.Store.List(p)
|
list, e := s.Store.List(p)
|
||||||
if e != nil {
|
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
|
return
|
||||||
}
|
}
|
||||||
out := make([]fileInfo, 0, len(list))
|
out := make([]fileInfo, 0, len(list))
|
||||||
|
|||||||
Reference in New Issue
Block a user