From 0d085ec1759d57ae98ab0e28096d02b0a8b3023c Mon Sep 17 00:00:00 2001 From: a <edward9.lee@gmail.com> Date: Tue, 31 Jan 2023 08:54:40 -0600 Subject: [PATCH] make directory lister trigger if mime type is httpd/unix-directory (#4169) --- weed/server/filer_server_handlers_read.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/weed/server/filer_server_handlers_read.go b/weed/server/filer_server_handlers_read.go index 06e4b72c8..58d1928c6 100644 --- a/weed/server/filer_server_handlers_read.go +++ b/weed/server/filer_server_handlers_read.go @@ -15,6 +15,8 @@ import ( "strings" "time" + "golang.org/x/exp/slices" + "github.com/seaweedfs/seaweedfs/weed/filer" "github.com/seaweedfs/seaweedfs/weed/glog" "github.com/seaweedfs/seaweedfs/weed/images" @@ -118,7 +120,7 @@ func (fs *FilerServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request) writeJsonQuiet(w, r, http.StatusOK, entry) return } - if entry.Attr.Mime == "" { + if slices.Contains([]string{"httpd/unix-directory", ""}, entry.Attr.Mime) { fs.listDirectoryHandler(w, r) return }