0
Fork 0
mirror of https://github.com/project-zot/zot.git synced 2024-12-16 21:56:37 -05:00

routes: fix CheckManifest to return content length

Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>
This commit is contained in:
Ramkumar Chinchani 2021-11-18 19:08:33 +00:00 committed by Ramkumar Chinchani
parent a176bf7e83
commit 5f8f61407e

View file

@ -279,7 +279,7 @@ func (rh *RouteHandler) CheckManifest(w http.ResponseWriter, r *http.Request) {
return
}
_, digest, mediaType, err := getImageManifest(rh, is, name, reference)
content, digest, mediaType, err := getImageManifest(rh, is, name, reference)
if err != nil {
switch err {
case errors.ErrRepoNotFound:
@ -298,7 +298,7 @@ func (rh *RouteHandler) CheckManifest(w http.ResponseWriter, r *http.Request) {
}
w.Header().Set(DistContentDigestKey, digest)
w.Header().Set("Content-Length", "0")
w.Header().Set("Content-Length", fmt.Sprintf("%d", len(content)))
w.Header().Set("Content-Type", mediaType)
w.WriteHeader(http.StatusOK)
}