mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-04-05 20:52:50 +08:00
Fix get dir metadata (#5923)
* fix:mount deadlock * feat: query dir metadata * feat: query dir metadata --------- Co-authored-by: zemul <zhouzemiao@ihuman.com>
This commit is contained in:
parent
6ce27affa4
commit
95bae91ca7
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user