Commit 1d792d6c authored by Philipp Hörist's avatar Philipp Hörist

Protocol: Cache validation of JID parts

parent 6b3f7e09
Pipeline #5370 failed with stages
in 17 seconds
......@@ -760,6 +760,7 @@ def parse_jid(jid):
return localpart, domainpart, resourcepart
def validate_localpart(localpart):
if not localpart or len(localpart.encode()) > 1023:
raise LocalpartByteLimit
......@@ -774,6 +775,7 @@ def validate_localpart(localpart):
raise LocalpartNotAllowedChar
def validate_resourcepart(resourcepart):
if not resourcepart or len(resourcepart.encode()) > 1023:
raise ResourcepartByteLimit
......@@ -785,6 +787,7 @@ def validate_resourcepart(resourcepart):
raise ResourcepartNotAllowedChar
def validate_domainpart(domainpart):
# Check if this is a IPV4 address
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment