You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// SetRequestCallbacks sets callbacks which will be invoked before each request.
func (c *Client) SetRequestCallbacks(callbacks ...RequestCallback) error {
c.clientRequestModifiersLock.Lock()
copy(c.clientRequestModifiers.requestCallbacks, callbacks)
c.clientRequestModifiersLock.Unlock()
return nil
}
Expected Behavior
When using
SetRequestCallbacks
, i expected thecallbacks
should be set to therequestCallbacks
in client.Current Behavior
The
requestCallbacks
in client is still empty.I think the reason the
requestCallbacks
not being copy is due to the copy function.vault-client-go/request_modifiers.go
Line 173 in fd98162
As mentioned in the Copy,
So, when the client is initialized as no
requestCallbacks
, the copy function will always copy nothing to therequestCallbacks
.To solve the bug, I think you can change to use
append
to fix it.Failure Information
vault-client-go: 0.4.1
Please include the version of Vault binary and the version of
vault-client-go
you're using.Steps to Reproduce
Please provide detailed steps for reproducing the issue.
Additional Information
I think the
SetResponseCallbacks
having same issue.vault-client-go/request_modifiers.go
Line 190 in fd98162
The text was updated successfully, but these errors were encountered: