From: Aki Tuomi Date: Sat, 9 Jan 2016 13:53:45 +0000 (+0200) Subject: Properly prepare POST for transaction X-Git-Tag: dnsdist-1.0.0-alpha2~36^2~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b6daf512da406908f1ee7f2935e5466815dc6a10;p=pdns Properly prepare POST for transaction --- diff --git a/modules/remotebackend/httpconnector.cc b/modules/remotebackend/httpconnector.cc index 5ac830911..5ae2b2704 100644 --- a/modules/remotebackend/httpconnector.cc +++ b/modules/remotebackend/httpconnector.cc @@ -96,6 +96,7 @@ void HTTPConnector::restful_requestbuilder(const std::string &method, const Json // set the correct type of request based on method if (method == "activateDomainKey" || method == "deactivateDomainKey") { // create an empty post + req.preparePost(); verb = "POST"; } else if (method == "setTSIGKey") { req.POST()["algorithm"] = parameters["algorithm"].string_value(); @@ -180,9 +181,11 @@ void HTTPConnector::restful_requestbuilder(const std::string &method, const Json } else if (method == "startTransaction") { addUrlComponent(parameters, "domain", ss); addUrlComponent(parameters, "trxid", ss); + req.preparePost(); verb = "POST"; } else if (method == "commitTransaction" || method == "abortTransaction") { addUrlComponent(parameters, "trxid", ss); + req.preparePost(); verb = "POST"; } else if (method == "calculateSOASerial") { addUrlComponent(parameters, "domain", ss); @@ -233,7 +236,7 @@ void HTTPConnector::restful_requestbuilder(const std::string &method, const Json member == "real-remote" || member == "zone-id")) { std::string hdr = "x-remotebackend-" + member; - req.headers[hdr] = pair.second.string_value(); + req.headers[hdr] = asString(pair.second); } };