Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/python-nbxmpp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/nbxmpp
diff options
context:
space:
mode:
authorlovetox <philipp@hoerist.com>2020-08-16 23:20:35 +0300
committerlovetox <philipp@hoerist.com>2020-08-16 23:20:35 +0300
commit47daf6a9313dbccc01739681fd551b3d2b32e12b (patch)
tree6ac80af918ffd55f9c04e180fc36063fc1a301f9 /nbxmpp
parente5f5effc3065d1f6942915b6ab2a5a2a5584ffed (diff)
Strip [] before hostname check
Diffstat (limited to 'nbxmpp')
-rw-r--r--nbxmpp/protocol.py5
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]