Skip to content

Commit

Permalink
Fix invalid escape sequence in domain regex
Browse files Browse the repository at this point in the history
  • Loading branch information
De117 committed Nov 11, 2022
1 parent ef1bb67 commit d77da57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion whitelisting_proxy/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def __init__(self, s: str):
letter_digit = "[a-zA-Z0-9]"
letter = "[a-zA-Z]"
label = f"{letter}({letter_digit_hyphen}*{letter_digit}+)*"
domain = f"({label}\.)*{label}"
domain = f"({label}\\.)*{label}"

if not re.match(f"^{domain}$", s):
raise ValueError("Malformed domain: " + s)
Expand Down

0 comments on commit d77da57

Please sign in to comment.