Skip to content

Commit 3032150

Browse files
authored
fix(rpc/client): handle empty auth token (#4197)
1 parent 5f48673 commit 3032150

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

api/rpc/client/client.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ func (c *Client) Close() {
6666
// NewClient creates a new Client with one connection per namespace with the
6767
// given token as the authorization token.
6868
func NewClient(ctx context.Context, addr, token string) (*Client, error) {
69-
authHeader := http.Header{perms.AuthKey: []string{fmt.Sprintf("Bearer %s", token)}}
69+
var authHeader http.Header
70+
if token != "" {
71+
authHeader = http.Header{perms.AuthKey: []string{fmt.Sprintf("Bearer %s", token)}}
72+
}
7073
return newClient(ctx, addr, authHeader)
7174
}
7275

0 commit comments

Comments
 (0)