diff options
author | lovetox <philipp@hoerist.com> | 2020-08-16 23:20:35 +0300 |
---|---|---|
committer | lovetox <philipp@hoerist.com> | 2020-08-16 23:20:35 +0300 |
commit | 47daf6a9313dbccc01739681fd551b3d2b32e12b (patch) | |
tree | 6ac80af918ffd55f9c04e180fc36063fc1a301f9 /nbxmpp | |
parent | e5f5effc3065d1f6942915b6ab2a5a2a5584ffed (diff) |
Strip [] before hostname check
Diffstat (limited to 'nbxmpp')
-rw-r--r-- | nbxmpp/protocol.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/nbxmpp/protocol.py b/nbxmpp/protocol.py index e802595..fcf07c0 100644 --- a/nbxmpp/protocol.py +++ b/nbxmpp/protocol.py @@ -717,8 +717,9 @@ def validate_domainpart(domainpart): if not domainpart: raise DomainpartByteLimit - if GLib.hostname_is_ip_address(domainpart): - return domainpart + ip_address = domainpart.strip('[]') + if GLib.hostname_is_ip_address(ip_address): + return ip_address if domainpart.endswith('.'): # RFC7622, 3.2 domainpart = domainpart[:-1] |