mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
credentials: let GetRequestMetadata() return nil when authToken isn't initialized.
Signed-off-by: Chao Chen <chaochn@amazon.com>
This commit is contained in:
parent
1fc259d655
commit
0cf5a72c2a
@ -156,6 +156,9 @@ func (rc *perRPCCredential) GetRequestMetadata(ctx context.Context, s ...string)
|
||||
rc.authTokenMu.RLock()
|
||||
authToken := rc.authToken
|
||||
rc.authTokenMu.RUnlock()
|
||||
if authToken == "" {
|
||||
return nil, nil
|
||||
}
|
||||
return map[string]string{rpctypes.TokenFieldNameGRPC: authToken}, nil
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user