From 30a6f7107e9e633cef70b3b104aa1c6eb2db751b Mon Sep 17 00:00:00 2001 From: Euclid Date: Fri, 10 Mar 2023 21:21:24 +0800 Subject: [PATCH] fixed #2462 v9 continue support dragonfly, it's Hello command return "NOAUTH Authentication required" error (#2479) * fixed #2462 error NOAUTH and support dragonfly * check add comment * alignment --------- Co-authored-by: Monkey --- redis.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/redis.go b/redis.go index 6eed8424..7129ac9b 100644 --- a/redis.go +++ b/redis.go @@ -285,7 +285,9 @@ func (c *baseClient) initConn(ctx context.Context, cn *pool.Conn) error { // we continue to provide services with RESP2. if err := conn.Hello(ctx, 3, username, password, "").Err(); err == nil { auth = true - } else if !strings.HasPrefix(err.Error(), "ERR unknown command") { + } else if !strings.HasPrefix(err.Error(), "ERR unknown command") && + // this check is for compatibility DragonflyDB. + !strings.HasPrefix(err.Error(), "NOAUTH Authentication") { return err }