Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
Signed-off-by: ahmedsobeh <[email protected]>
  • Loading branch information
ahmedsobeh committed Jul 1, 2024
1 parent e531e77 commit 29ad108
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion valkey/_parsers/url_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def to_bool(value) -> Optional[bool]:

def parse_url(url: str, async_connection: bool):
url_prefixes = ["valkey://", "valkeys://", "unix://", "redis://", "rediss://"]
supported_schemes = ["valkey", "valkeys", "redis", "rediss"]

if not any(url.startswith(prefix) for prefix in url_prefixes):
raise ValueError(
Expand Down Expand Up @@ -73,7 +74,7 @@ def parse_url(url: str, async_connection: bool):
else UnixDomainSocketConnection
)

elif parsed.scheme in ("valkey", "valkeys", "redis", "rediss"):
elif parsed.scheme in supported_schemes:
if parsed.hostname:
kwargs["host"] = unquote(parsed.hostname)
if parsed.port:
Expand Down

0 comments on commit 29ad108

Please sign in to comment.