Browse Source

filer: get directory metadata (#3833)

pull/3838/head
zemul 2 years ago
committed by GitHub
parent
commit
a05725aea6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      weed/server/filer_server_handlers_read.go

9
weed/server/filer_server_handlers_read.go

@ -107,9 +107,15 @@ func (fs *FilerServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request)
return
}
query := r.URL.Query()
if entry.IsDirectory() {
if fs.option.DisableDirListing {
w.WriteHeader(http.StatusMethodNotAllowed)
w.WriteHeader(http.StatusForbidden)
return
}
if query.Get("metadata") == "true" {
writeJsonQuiet(w, r, http.StatusOK, entry)
return
}
if entry.Attr.Mime == "" {
@ -125,7 +131,6 @@ func (fs *FilerServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request)
return
}
query := r.URL.Query()
if query.Get("metadata") == "true" {
if query.Get("resolveManifest") == "true" {
if entry.Chunks, _, err = filer.ResolveChunkManifest(

Loading…
Cancel
Save