diff --git a/CHANGELOG.md b/CHANGELOG.md index d089969..03b4505 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#869](https://github.com/spegel-org/spegel/pull/869) Fix request logging for redirects and not found pages. - [#872](https://github.com/spegel-org/spegel/pull/872) Allow returning libp2p crypto priv key in linter. - [#894](https://github.com/spegel-org/spegel/pull/894) Update Kind to v0.29.0 and Fix Containerd v2 support. +- [#899](https://github.com/spegel-org/spegel/pull/899) Handle situation where digest is missing in reigstry response header. ### Security diff --git a/pkg/oci/client.go b/pkg/oci/client.go index d71a321..bc0f1b2 100644 --- a/pkg/oci/client.go +++ b/pkg/oci/client.go @@ -205,6 +205,9 @@ func (c *Client) fetch(ctx context.Context, method string, dist DistributionPath return nil, ocispec.Descriptor{}, err } + if resp.Header.Get(HeaderDockerDigest) == "" { + resp.Header.Set(HeaderDockerDigest, dist.Digest.String()) + } desc, err := DescriptorFromHeader(resp.Header) if err != nil { return nil, ocispec.Descriptor{}, err