rest: call the Signer with the mutex unlocked

This enables the signer to adjust rest parameters and call rest again
if necessary.
This commit is contained in:
Nick Craig-Wood
2020-01-17 15:00:23 +00:00
parent 65071599a2
commit 14e93bfd8a
+2
View File
@@ -269,7 +269,9 @@ func (api *Client) Call(ctx context.Context, opts *Opts) (resp *http.Response, e
c = api.c
}
if api.signer != nil {
api.mu.RUnlock()
err = api.signer(req)
api.mu.RLock()
if err != nil {
return nil, errors.Wrap(err, "signer failed")
}