From: Christian Hofstaedtler Date: Sun, 27 Dec 2015 23:18:39 +0000 (+0100) Subject: API: port auth zones /export to json11 X-Git-Tag: dnsdist-1.0.0-alpha2~123^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=41873e7cdd0b00b0ce0082c506a1153865003184;p=thirdparty%2Fpdns.git API: port auth zones /export to json11 --- diff --git a/pdns/ws-auth.cc b/pdns/ws-auth.cc index e3e610e8b0..b5b7647608 100644 --- a/pdns/ws-auth.cc +++ b/pdns/ws-auth.cc @@ -794,11 +794,7 @@ static void apiServerZoneExport(HttpRequest* req, HttpResponse* resp) { } if (req->accept_json) { - Document doc; - doc.SetObject(); - Value val(ss.str().c_str(), doc.GetAllocator()); // copy - doc.AddMember("zone", val, doc.GetAllocator()); - resp->body = makeStringFromDocument(doc); + resp->setBody(Json::object { { "zone", ss.str() } }); } else { resp->headers["Content-Type"] = "text/plain; charset=us-ascii"; resp->body = ss.str();