[#138] sdk/object: Fix head request

Now head request returns full header with signature.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2020-09-08 13:42:25 +03:00 committed by Stanislav Bogatyrev
parent 581cb2d2ba
commit efbf73b775

View file

@ -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: default:
panic(fmt.Sprintf("unexpected Head object type %T", v)) panic(fmt.Sprintf("unexpected Head object type %T", v))
} }