Skip to content

Commit

Permalink
Issuer URL recognition bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vrbanecd committed Feb 28, 2024
1 parent 8bd8cb7 commit 9a8bdd3
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions flaat/issuers.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,9 @@
def is_url(string):
"""Return True if parameter is a URL, otherwise False"""
regex = re.compile(
r"^(?:http|ftp)s?://" # http:// or https://
r"(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)|" # domain...
r"localhost|" # localhost...
r"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})" # ...or ip
r"(?::\d+)?" # optional port
r"(?:/?|[/?]\S+)$",
r"^(?:http|ftp)s?:\/\/"
r"(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?)(?:\.[A-Z]{2,6}|[A-Z0-9-]{2,})*\.?|\d{1,3}\."
r"\d{1,3}\.\d{1,3}\.\d{1,3})(?::\d+)?(?:\/?|[\/?]\S+)$",
re.IGNORECASE,
)
if re.match(regex, string):
Expand Down

0 comments on commit 9a8bdd3

Please sign in to comment.