Skip to content

Commit a5a90b2

Browse files
committed
fix: skip endswith guard for regex zones in check_rrset_allowed
When zone.regex is True, zone.name is a pattern like '.*' rather than a real DNS name. The endswith guard was always False for these zones, causing regex_records to never be evaluated and all writes to be denied. Fixes #196
1 parent 1d9d664 commit a5a90b2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

powerdns_api_proxy/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def check_rrset_allowed(zone: ProxyConfigZone, rrset: RRSET) -> bool:
155155
if zone.all_records:
156156
return True
157157

158-
if not rrset["name"].rstrip(".").endswith(zone.name.rstrip(".")):
158+
if not zone.regex and not rrset["name"].rstrip(".").endswith(zone.name.rstrip(".")):
159159
logger.debug("RRSET not allowed, because zone does not match")
160160
return False
161161

0 commit comments

Comments
 (0)