in pkg/handlers/v2/handler.go [65:85]
func (h *V2Handler) fill(c pcontext.Context) error {
c.Set("handler", "v2")
ns := c.Query("ns")
if ns == "" {
ns = "docker.io"
}
c.Set(pcontext.NamespaceCtxKey, ns)
ref, dgst, refType, err := distribution.ParsePathComponents(ns, c.Request.URL.Path)
if err != nil {
return err
}
c.Set(pcontext.ReferenceCtxKey, ref)
c.Set(pcontext.DigestCtxKey, dgst.String())
c.Set(pcontext.RefTypeCtxKey, refType)
return nil
}