aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2022-06-12 12:28:21 +0700
committerShulhan <ms@kilabit.info>2022-06-12 13:02:22 +0700
commitdbbf768254182ad12be3ecedf61685f8e18201a3 (patch)
treea909984a6af151ef3e68804f2932ce09a2883f53
parentb76e182e94f55ce542ba336ea35bcb108e924c3f (diff)
downloadrescached-dbbf768254182ad12be3ecedf61685f8e18201a3.tar.xz
all: trim the zone's name from request on HTTP API zone.d record delete
When calling API for zone.d record delete, client send the fully qualified domain name on record to be deleted, but caches store only the subdomains internally. This cause the delete action fail, because no internal record match with request.
-rw-r--r--httpd.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/httpd.go b/httpd.go
index 09ac8c8..6a4c2bb 100644
--- a/httpd.go
+++ b/httpd.go
@@ -1498,6 +1498,7 @@ func (srv *Server) apiZonedRRDelete(epr *libhttp.EndpointRequest) (resbody []byt
}
rr.Name = strings.TrimRight(rr.Name, ".")
+ rr.Name = strings.TrimRight(rr.Name, zone.Name)
if rr.Type == dns.RecordTypePTR {
if len(rr.Name) == 0 {