Skip to content

Commit

Permalink
clientv3: let GetRequestMetadata() return nil when authToken isn't in…
Browse files Browse the repository at this point in the history
…itialized
  • Loading branch information
mitake committed Aug 15, 2020
1 parent 708b0cb commit 747cc70
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions clientv3/credentials/credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,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
}

Expand Down

0 comments on commit 747cc70

Please sign in to comment.