working commit

This commit is contained in:
2026-02-06 19:15:12 +02:00
parent fe91517e3f
commit f76881a765
14 changed files with 478 additions and 20 deletions
+9 -8
View File
@@ -15,21 +15,22 @@ import (
"mstore/app/operator"
"mstore/app/router"
"sigs.k8s.io/yaml"
)
func (hand *Handler) DumpHeaders(message string, rctx *router.Context) {
headers := rctx.GetHeaders()
yamlData, _ := yaml.Marshal(headers)
hand.logg.Debugf("%s:\n%s\n", message, string(yamlData))
}
// HEAD /v2/<name>/blobs/<digest> 200 404
func (hand *Handler) BlobExists(rctx *router.Context) {
name, _ := rctx.GetSubpath("name")
digest, _ := rctx.GetSubpath("digest")
auth := rctx.GetHeader("Authorization")
hand.DumpHeaders("BlobExists", rctx)
if auth == "" {
rctx.SetHeader("WWW-Authenticate", `Basic realm="mstore"`)
rctx.SetStatus(http.StatusUnauthorized)
return
}
params := &operator.BlobExistsParams{
Name: name,
Digest: digest,