[#334] client: Use parameter key in object.Get

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-09-14 09:02:26 +03:00 committed by LeL
parent 1929b634a1
commit f75a5feba3

View file

@ -321,7 +321,12 @@ func (c *Client) ObjectGetInit(ctx context.Context, prm PrmObjectGet) (*ObjectRe
req.SetBody(&body) req.SetBody(&body)
c.prepareRequest(&req, &prm.meta) c.prepareRequest(&req, &prm.meta)
err := signature.SignServiceMessage(&c.prm.key, &req) key := prm.key
if key == nil {
key = &c.prm.key
}
err := signature.SignServiceMessage(key, &req)
if err != nil { if err != nil {
return nil, fmt.Errorf("sign request: %w", err) return nil, fmt.Errorf("sign request: %w", err)
} }