mirror of https://github.com/go-redis/redis.git
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 <golang@88.com>
This commit is contained in:
parent
6501a8b15e
commit
30a6f7107e
4
redis.go
4
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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue