mirror of
https://github.com/project-zot/zot.git
synced 2026-06-16 04:17:55 +08:00
routes: fix CheckManifest to return content length
Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>
This commit is contained in:
committed by
Ramkumar Chinchani
parent
a176bf7e83
commit
5f8f61407e
+2
-2
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user