From de7fd3c605ed09d75efb8e456d7b187d645dbb0e Mon Sep 17 00:00:00 2001 From: Peter van Dijk Date: Thu, 3 Mar 2022 11:18:56 +0100 Subject: [PATCH] ws-auth: small refactor to pass full req to fillZone --- pdns/ws-auth.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pdns/ws-auth.cc b/pdns/ws-auth.cc index c409923f97..a22117af45 100644 --- a/pdns/ws-auth.cc +++ b/pdns/ws-auth.cc @@ -348,7 +348,7 @@ static bool shouldDoRRSets(HttpRequest* req) { throw ApiException("'rrsets' request parameter value '"+req->getvars["rrsets"]+"' is not supported"); } -static void fillZone(UeberBackend& B, const DNSName& zonename, HttpResponse* resp, bool doRRSets) { +static void fillZone(UeberBackend& B, const DNSName& zonename, HttpResponse* resp, HttpRequest* req) { DomainInfo di; if(!B.getDomainInfo(zonename, di)) { throw HttpNotFoundException(); @@ -395,7 +395,7 @@ static void fillZone(UeberBackend& B, const DNSName& zonename, HttpResponse* res } doc["slave_tsig_key_ids"] = tsig_slave_keys; - if (doRRSets) { + if (shouldDoRRSets(req)) { vector records; vector comments; @@ -1817,7 +1817,7 @@ static void apiServerZones(HttpRequest* req, HttpResponse* resp) { g_zoneCache.add(zonename, di.id); // make new zone visible - fillZone(B, zonename, resp, shouldDoRRSets(req)); + fillZone(B, zonename, resp, req); resp->status = 201; return; } @@ -1913,7 +1913,7 @@ static void apiServerZoneDetail(HttpRequest* req, HttpResponse* resp) { patchZone(B, req, resp); return; } else if (req->method == "GET") { - fillZone(B, zonename, resp, shouldDoRRSets(req)); + fillZone(B, zonename, resp, req); return; } throw HttpMethodNotAllowedException(); -- 2.47.2