From 2d6b934a0b8b120dc7ee3589dc97a6ee091ed8bf Mon Sep 17 00:00:00 2001 From: ahmedsobeh Date: Wed, 3 Jul 2024 15:13:38 +0200 Subject: [PATCH] fixed broken tests Signed-off-by: ahmedsobeh --- valkey/_parsers/url_parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/valkey/_parsers/url_parser.py b/valkey/_parsers/url_parser.py index c335336f..06cf17e5 100644 --- a/valkey/_parsers/url_parser.py +++ b/valkey/_parsers/url_parser.py @@ -40,8 +40,8 @@ def parse_url(url: str, async_connection: bool): supported_schemes = ["valkey", "valkeys", "redis", "rediss", "unix"] parsed: ParseResult = urlparse(url) kwargs: ConnectKwargs = {} - pattern = re.compile(r"^{}://".format(re.escape(url))) - if pattern.match(url): + pattern = re.compile(r'^(?:' + '|'.join(map(re.escape, supported_schemes)) + r')://') + if not pattern.match(url): raise ValueError( f"Valkey URL must specify one of the following schemes {supported_schemes}" )