Handle situation where digest is missing in reigstry response header
Signed-off-by: Philip Laine <philip.laine@gmail.com>
This commit is contained in:
parent
7a2420f7d5
commit
61f7d14a92
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user