Handle situation where digest is missing in reigstry response header

Signed-off-by: Philip Laine <philip.laine@gmail.com>
This commit is contained in:
Philip Laine 2025-05-26 19:15:14 +02:00
parent 7a2420f7d5
commit 61f7d14a92
No known key found for this signature in database
GPG Key ID: F6D0B743CA3EFF33
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