From 1487cfdd7049557a8a19225a729956b656c72526 Mon Sep 17 00:00:00 2001 From: Georg Pfuetzenreuter Date: Sun, 20 Oct 2024 21:49:09 +0200 Subject: [PATCH] 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 --- pdns-genrev.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pdns-genrev.py b/pdns-genrev.py index 4f0c5e7..899b773 100755 --- a/pdns-genrev.py +++ b/pdns-genrev.py @@ -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: