Skip to content

Commit a2b7db5

Browse files
committed
Fix copy-paste error in CacheProxyConnection server version check
The condition on line 1417 incorrectly checked 'server_ver is None or server_ver is None' when it should check 'server_ver is None or server_name is None'. This bug would allow server_name to be None without raising an error, which would then cause issues when server_name is used later in the comparison at line 1424.
1 parent 6063a86 commit a2b7db5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

redis/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1414,7 +1414,7 @@ def connect(self):
14141414
server_ver = self._conn.handshake_metadata.get(b"version", None)
14151415
if server_ver is None:
14161416
server_ver = self._conn.handshake_metadata.get("version", None)
1417-
if server_ver is None or server_ver is None:
1417+
if server_ver is None or server_name is None:
14181418
raise ConnectionError("Cannot retrieve information about server version")
14191419

14201420
server_ver = ensure_string(server_ver)

0 commit comments

Comments
 (0)