From efbf73b775623c15a15b9f1e54c5fef0e5e22b2c Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Tue, 8 Sep 2020 13:42:25 +0300 Subject: [PATCH] [#138] sdk/object: Fix head request Now head request returns full header with signature. Signed-off-by: Alex Vanin --- pkg/client/object.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/client/object.go b/pkg/client/object.go index 3bedecfb..a5323cf1 100644 --- a/pkg/client/object.go +++ b/pkg/client/object.go @@ -564,7 +564,12 @@ func (c *Client) getObjectHeaderV2(ctx context.Context, p *ObjectHeaderParams, o ) } - hdr = v.GetHeader() + hdrWithSig := v.GetHeaderWithSignature() + if hdrWithSig == nil { + return nil, errors.New("got nil instead of header with signature") + } + hdr = hdrWithSig.GetHeader() + // todo: check signature there default: panic(fmt.Sprintf("unexpected Head object type %T", v)) }