rest: call the Signer with the mutex unlocked

This enables the signer to adjust rest parameters and call rest again
if necessary.
s3-about
Nick Craig-Wood 2019-11-02 10:16:58 +00:00
parent 65071599a2
commit 14e93bfd8a
1 changed files with 2 additions and 0 deletions

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")
}