Skip to content

Commit 30a6f71

Browse files
xinzhanguomonkey92t
andauthoredMar 10, 2023
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 <[email protected]>
1 parent 6501a8b commit 30a6f71

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

Diff for: ‎redis.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,9 @@ func (c *baseClient) initConn(ctx context.Context, cn *pool.Conn) error {
285285
// we continue to provide services with RESP2.
286286
if err := conn.Hello(ctx, 3, username, password, "").Err(); err == nil {
287287
auth = true
288-
} else if !strings.HasPrefix(err.Error(), "ERR unknown command") {
288+
} else if !strings.HasPrefix(err.Error(), "ERR unknown command") &&
289+
// this check is for compatibility DragonflyDB.
290+
!strings.HasPrefix(err.Error(), "NOAUTH Authentication") {
289291
return err
290292
}
291293

0 commit comments

Comments
 (0)
Please sign in to comment.