Skip to content

Commit 523cfed

Browse files
JP fix(email): accept IPv6 prefix in address literals
HU-02: Strip the IPv6: prefix from bracketed email domain literals before IP validation. Addresses the existing test_email_accepts_ipv6_literal_with_prefix test.
1 parent 0a4e300 commit 523cfed

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎src/validators/email.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ def email(
6868
if domain_part.startswith("[") and domain_part.endswith("]"):
6969
# ref: RFC 5321
7070
domain_part = domain_part.lstrip("[").rstrip("]")
71+
if ipv6_address and domain_part.startswith("IPv6:"):
72+
domain_part = domain_part[5:]
7173
else:
7274
return False
7375

0 commit comments

Comments
 (0)