From: Peter van Dijk Date: Thu, 3 Mar 2022 10:18:56 +0000 (+0100) Subject: ws-auth: small refactor to pass full req to fillZone X-Git-Tag: rec-4.7.0-beta1~63^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=de7fd3c605ed09d75efb8e456d7b187d645dbb0e;p=thirdparty%2Fpdns.git ws-auth: small refactor to pass full req to fillZone --- 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();