Merge pull request #1270 from YunoHost/enh-punycode

[fix] Better support for non latin domain name
This commit is contained in:
Alexandre Aubin 2021-08-08 19:06:52 +02:00 committed by GitHub
commit 253ec15076
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -115,6 +115,9 @@ def domain_add(operation_logger, domain, dyndns=False):
# See: https://forum.yunohost.org/t/invalid-domain-causes-diagnosis-web-to-fail-fr-on-demand/11765
domain = domain.lower()
# Non-latin characters (e.g. café.com => xn--caf-dma.com)
domain = domain.encode('idna').decode('utf-8')
# DynDNS domain
if dyndns: