diff --git a/weed/server/filer_server_handlers_read.go b/weed/server/filer_server_handlers_read.go index bf95e37b9..5bd59b23f 100644 --- a/weed/server/filer_server_handlers_read.go +++ b/weed/server/filer_server_handlers_read.go @@ -74,7 +74,12 @@ func (fs *FilerServer) listDirectoryHandler(w http.ResponseWriter, r *http.Reque lastFileName, shouldDisplayLoadMore, } - ui.StatusTpl.Execute(w, args) + + if strings.ToLower(r.Header.Get("Content-Type")) == "application/json" { + writeJsonQuiet(w, r, http.StatusOK, args) + } else { + ui.StatusTpl.Execute(w, args) + } } func (fs *FilerServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request, isGetMethod bool) {