From dbbf768254182ad12be3ecedf61685f8e18201a3 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Sun, 12 Jun 2022 12:28:21 +0700 Subject: 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. --- httpd.go | 1 + 1 file changed, 1 insertion(+) 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 { -- cgit v1.3