From 41aba0c02c5477699ba41e2541988a1617705417 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Fri, 12 Oct 2018 00:45:28 -0700 Subject: [PATCH] fix when no files in filer --- weed/server/filer_server_handlers_read.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/weed/server/filer_server_handlers_read.go b/weed/server/filer_server_handlers_read.go index eaa8015a6..554ce3fd1 100644 --- a/weed/server/filer_server_handlers_read.go +++ b/weed/server/filer_server_handlers_read.go @@ -23,6 +23,10 @@ func (fs *FilerServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request, entry, err := fs.filer.FindEntry(filer2.FullPath(path)) if err != nil { + if path == "/" { + fs.listDirectoryHandler(w, r) + return + } glog.V(1).Infof("Not found %s: %v", path, err) w.WriteHeader(http.StatusNotFound) return