From f75a5feba3355bc6ea3ddcdd8a7d553e2538c7f4 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 14 Sep 2022 09:02:26 +0300 Subject: [PATCH] [#334] client: Use parameter key in object.Get Signed-off-by: Evgenii Stratonikov --- client/object_get.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/object_get.go b/client/object_get.go index ee86e38a..12d332c3 100644 --- a/client/object_get.go +++ b/client/object_get.go @@ -321,7 +321,12 @@ func (c *Client) ObjectGetInit(ctx context.Context, prm PrmObjectGet) (*ObjectRe req.SetBody(&body) 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 { return nil, fmt.Errorf("sign request: %w", err) }