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:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user