1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-28 06:42:00 +03:00

Set client name in HELLO RESP handshake (#3294)

This commit is contained in:
LINKIWI
2025-03-13 05:55:28 -07:00
committed by GitHub
parent 555a41ecc7
commit 1c9309fdc2
2 changed files with 27 additions and 1 deletions

View File

@ -310,7 +310,7 @@ func (c *baseClient) initConn(ctx context.Context, cn *pool.Conn) error {
// for redis-server versions that do not support the HELLO command,
// RESP2 will continue to be used.
if err = conn.Hello(ctx, protocol, username, password, "").Err(); err == nil {
if err = conn.Hello(ctx, protocol, username, password, c.opt.ClientName).Err(); err == nil {
auth = true
} else if !isRedisError(err) {
// When the server responds with the RESP protocol and the result is not a normal