Browse Source
Merge pull request #2729 from banjiaojuhao/filer_metadata-resolve-manifest
filer: support get metadata with resolved manifest chunk
pull/2733/head
Chris Lu
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
10 additions and
1 deletions
-
weed/server/filer_server_handlers_read.go
|
@ -119,7 +119,16 @@ func (fs *FilerServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if r.URL.Query().Has("metadata") { |
|
|
|
|
|
|
|
|
query := r.URL.Query() |
|
|
|
|
|
if query.Get("metadata") == "true" { |
|
|
|
|
|
if query.Get("resolveManifest") == "true" { |
|
|
|
|
|
if entry.Chunks, _, err = filer.ResolveChunkManifest( |
|
|
|
|
|
fs.filer.MasterClient.GetLookupFileIdFunction(), |
|
|
|
|
|
entry.Chunks, 0, int64(entry.Size())); err != nil { |
|
|
|
|
|
err = fmt.Errorf("failed to resolve chunk manifest, err: %s", err.Error()) |
|
|
|
|
|
writeJsonError(w, r, http.StatusInternalServerError, err) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
writeJsonQuiet(w, r, http.StatusOK, entry) |
|
|
writeJsonQuiet(w, r, http.StatusOK, entry) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|