Commit 78ebaefa authored by Philipp Hörist's avatar Philipp Hörist
Browse files

Dont punycode encode all domain names

RFC7622 3.2.1

... This implies that the string MUST NOT include A-labels ...

Fixes #9211
parent 86eddc2e
......@@ -61,12 +61,6 @@
except ImportError:
HAS_PRECIS_I18N = False
try:
import idna
HAS_IDNA = True
except ImportError:
HAS_IDNA = False
HAS_SOUND = True
if sys.platform == 'win32':
try:
......@@ -296,9 +290,6 @@ def prep(user, server, resource):
if len(server) < 1 or len(server.encode('utf-8')) > 1023:
raise InvalidFormat(_('Server must be between 1 and 1023 bytes'))
try:
if HAS_IDNA:
server = idna.encode(server).decode('utf-8')
else:
from nbxmpp.stringprepare import nameprep
server = nameprep.prepare(server)
except UnicodeError:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment