From e042bef3c0c0e2a6a7ead21b90ae209b11d22fb8 Mon Sep 17 00:00:00 2001 From: chulin <316014408@qq.com> Date: Wed, 28 Dec 2016 09:51:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=9C=E8=80=85=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- weed/server/filer_server_handlers_read.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/weed/server/filer_server_handlers_read.go b/weed/server/filer_server_handlers_read.go index cd6fb4849..fda3f3588 100644 --- a/weed/server/filer_server_handlers_read.go +++ b/weed/server/filer_server_handlers_read.go @@ -82,7 +82,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) {