Changed tld length to be anything over 1 character

This commit is contained in:
Matthew Ames 2015-11-17 23:41:26 +00:00
parent e739c3327c
commit 78733ae0cb

View file

@ -155,8 +155,8 @@ def _check_config_domain_sanity(domains):
"Punycode domains are not supported")
# FQDN checks from
# http://www.mkyong.com/regular-expressions/domain-name-regular-expression-example/
# Characters used, domain parts < 63 chars, tld > 1 < 13 chars
# Characters used, domain parts < 63 chars, tld > 1 char
# first and last char is not "-"
fqdn = re.compile("^((?!-)[A-Za-z0-9-]{1,63}(?<!-)\\.)+[A-Za-z]{2,12}$")
fqdn = re.compile("^((?!-)[A-Za-z0-9-]{1,63}(?<!-)\\.)+[A-Za-z]{2,}$")
if any(True for d in domains if not fqdn.match(d)):
raise errors.ConfigurationError("Requested domain is not a FQDN")