diff --git a/weed/server/filer_server_handlers_read.go b/weed/server/filer_server_handlers_read.go index a02e6c2c1..12371a8f6 100644 --- a/weed/server/filer_server_handlers_read.go +++ b/weed/server/filer_server_handlers_read.go @@ -122,13 +122,15 @@ func (fs *FilerServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request) return } if query.Get("metadata") == "true" { + writeJsonQuiet(w, r, http.StatusOK, entry) + return + } + if entry.Attr.Mime == "" || (entry.Attr.Mime == s3_constants.FolderMimeType && r.Header.Get(s3_constants.AmzIdentityId) == "") { // Don't return directory meta if config value is set to true if fs.option.ExposeDirectoryData == false { writeJsonError(w, r, http.StatusForbidden, errors.New("directory listing is disabled")) return } - } - if entry.Attr.Mime == "" || (entry.Attr.Mime == s3_constants.FolderMimeType && r.Header.Get(s3_constants.AmzIdentityId) == "") { // return index of directory for non s3 gateway fs.listDirectoryHandler(w, r) return