Browse Source

Fix get dir metadata (#5923)

* fix:mount deadlock

* feat: query dir metadata

* feat: query dir metadata

---------

Co-authored-by: zemul <zhouzemiao@ihuman.com>
pull/5903/merge
zemul 4 months ago
committed by GitHub
parent
commit
95bae91ca7
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 6
      weed/server/filer_server_handlers_read.go

6
weed/server/filer_server_handlers_read.go

@ -122,13 +122,15 @@ func (fs *FilerServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request)
return return
} }
if query.Get("metadata") == "true" { 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 // Don't return directory meta if config value is set to true
if fs.option.ExposeDirectoryData == false { if fs.option.ExposeDirectoryData == false {
writeJsonError(w, r, http.StatusForbidden, errors.New("directory listing is disabled")) writeJsonError(w, r, http.StatusForbidden, errors.New("directory listing is disabled"))
return 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 // return index of directory for non s3 gateway
fs.listDirectoryHandler(w, r) fs.listDirectoryHandler(w, r)
return return

Loading…
Cancel
Save