Escape zone names

Support zones containing slashes in their name by urlencoding the zone
name added to the API URL.

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
This commit is contained in:
Georg Pfuetzenreuter 2024-10-20 21:49:09 +02:00
parent 3f818e8ccb
commit 1487cfdd70
Signed by: Georg
GPG Key ID: 1ED2F138E7E6FF57

View File

@ -45,7 +45,9 @@ def _get(path):
def _iterate_zone(zone, types, only_records=False):
result = {}
records = []
this_zone = _get(f'zones/{zone}')
escapedzone = requests.utils.quote(zone, safe='')
this_zone = _get(f'zones/{escapedzone}')
for rrset in this_zone['rrsets']:
if rrset['type'] in types: