Handle situation where digest is missing in reigstry response header (#899)

This commit is contained in:
Philip Laine 2025-05-26 20:18:21 +02:00 committed by GitHub
commit cdff80e41f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View File

@ -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

View File

@ -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