From b6daf512da406908f1ee7f2935e5466815dc6a10 Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Sat, 9 Jan 2016 15:53:45 +0200 Subject: [PATCH] Properly prepare POST for transaction --- modules/remotebackend/httpconnector.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); } }; -- 2.40.0