From 7d1215a3ecf4b6d09387c5778e6d45f133257bd2 Mon Sep 17 00:00:00 2001 From: qkrwjdan Date: Tue, 4 Jul 2023 21:59:13 +0900 Subject: [PATCH] PYTHON-3800 Add lower() to node when validate hosts of srv records --- pymongo/srv_resolver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pymongo/srv_resolver.py b/pymongo/srv_resolver.py index 57c48f1e13..67b781cf9c 100644 --- a/pymongo/srv_resolver.py +++ b/pymongo/srv_resolver.py @@ -118,7 +118,7 @@ def _get_srv_response_and_hosts( # Validate hosts for node in nodes: try: - nlist = node[0].split(".")[1:][-self.__slen :] + nlist = node[0].lower().split(".")[1:][-self.__slen :] except Exception: raise ConfigurationError(f"Invalid SRV host: {node[0]}") if self.__plist != nlist: