Skip to content

Commit

Permalink
Fix handling of IDN's. (#17)
Browse files Browse the repository at this point in the history
* Update dns_infomaniak.py

Fix handling of IDN's

* Update dns_infomaniak.py

fix parentheses
  • Loading branch information
Fuechslein authored Jan 5, 2022
1 parent 9338076 commit 8ce0ec7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions certbot_dns_infomaniak/dns_infomaniak.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def add_txt_record(self, domain, source, target, ttl=300):
(domain_id, domain_name) = self._find_zone(domain)
logger.debug("%s / %s", domain_id, domain_name)
if source.endswith("." + domain_name):
relative_source = source[:source.rfind("." + domain_name)]
relative_source = source[:source.rfind("." + idna.encode(domain_name).decode("ascii"))]
else:
relative_source = source
logger.debug("add_txt_record %s %s %s", domain_name, relative_source, target)
Expand All @@ -229,7 +229,7 @@ def del_txt_record(self, domain, source, target):
logger.debug("del_txt_record %s %s %s", domain, source, target)
(domain_id, domain_name) = self._find_zone(domain)
if source.endswith("." + domain_name):
relative_source = source[:source.rfind("." + domain_name)]
relative_source = source[:source.rfind("." + idna.encode(domain_name).decode("ascii"))]
else:
relative_source = source
records = self._get_records(
Expand Down

0 comments on commit 8ce0ec7

Please sign in to comment.