Skip to content

Commit

Permalink
refactor: use fullmatch regex
Browse files Browse the repository at this point in the history
  • Loading branch information
dnechay committed Jan 29, 2025
1 parent b66355b commit e01993b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def from_url(cls, url: str) -> BucketAccessInfo:
elif Config.features.enable_custom_cloud_host:
# Check if netloc is an ip address
# or localhost with port (or its /etc/hosts aliast, e.g. minio:9000)
if is_ipv4(parsed_url.netloc) or re.match(r"^\w+:\d{4}$", parsed_url.netloc):
if is_ipv4(parsed_url.netloc) or re.fullmatch(r"\w+:\d{4}", parsed_url.netloc):
host = parsed_url.netloc
bucket_name, path = parsed_url.path.lstrip("/").split("/", maxsplit=1)
else:
Expand Down

0 comments on commit e01993b

Please sign in to comment.