From 5f8f61407edd598efd964e55e66a09acd3e25d92 Mon Sep 17 00:00:00 2001 From: Ramkumar Chinchani Date: Thu, 18 Nov 2021 19:08:33 +0000 Subject: [PATCH] routes: fix CheckManifest to return content length Signed-off-by: Ramkumar Chinchani --- pkg/api/routes.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/api/routes.go b/pkg/api/routes.go index 34c45037..1d7a8aa7 100644 --- a/pkg/api/routes.go +++ b/pkg/api/routes.go @@ -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) }