From ac99d29dd4eeebdc893df1b86500756cb8eac4c4 Mon Sep 17 00:00:00 2001 From: Jan Steemann Date: Thu, 7 Apr 2016 16:39:53 +0200 Subject: [PATCH] fixed misusage --- lib/Rest/GeneralRequest.cpp | 2 +- lib/Rest/GeneralResponse.cpp | 2 +- lib/Rest/HttpRequest.cpp | 3 --- lib/Rest/HttpRequest.h | 4 ---- 4 files changed, 2 insertions(+), 9 deletions(-) diff --git a/lib/Rest/GeneralRequest.cpp b/lib/Rest/GeneralRequest.cpp index e4add46e16..2a2c4d733f 100644 --- a/lib/Rest/GeneralRequest.cpp +++ b/lib/Rest/GeneralRequest.cpp @@ -273,6 +273,6 @@ std::string const& GeneralRequest::value(std::string const& key, bool& found) co void GeneralRequest::setArrayValue(char* key, size_t length, char const* value) { std::string keyStr(key, length); - _arrayValues[key].emplace_back(value); + _arrayValues[keyStr].emplace_back(value); } diff --git a/lib/Rest/GeneralResponse.cpp b/lib/Rest/GeneralResponse.cpp index ff6ac9ecd1..4f9ea9be8e 100644 --- a/lib/Rest/GeneralResponse.cpp +++ b/lib/Rest/GeneralResponse.cpp @@ -450,7 +450,7 @@ void GeneralResponse::setHeader(std::string const& key, std::string const& value) { std::string k = StringUtils::tolower(key); - _headers[key] = value; + _headers[k] = value; } void GeneralResponse::setHeaderNC(std::string const& key, diff --git a/lib/Rest/HttpRequest.cpp b/lib/Rest/HttpRequest.cpp index 8ebbb9d837..4f7e0c30e5 100644 --- a/lib/Rest/HttpRequest.cpp +++ b/lib/Rest/HttpRequest.cpp @@ -750,6 +750,3 @@ std::shared_ptr HttpRequest::toVelocyPack( return parser.steal(); } -TRI_json_t* HttpRequest::toJson(char** errmsg) { - return TRI_Json2String(TRI_UNKNOWN_MEM_ZONE, body().c_str(), errmsg); -} diff --git a/lib/Rest/HttpRequest.h b/lib/Rest/HttpRequest.h index af44d5cba5..6dc3ac46ec 100644 --- a/lib/Rest/HttpRequest.h +++ b/lib/Rest/HttpRequest.h @@ -28,7 +28,6 @@ #include "Rest/GeneralRequest.h" #include "Basics/StringBuffer.h" -#include "Basics/json.h" #include "Endpoint/ConnectionInfo.h" namespace arangodb { @@ -74,9 +73,6 @@ class HttpRequest : public GeneralRequest { std::shared_ptr toVelocyPack( arangodb::velocypack::Options const*); - // the request body as TRI_json_t* - TRI_json_t* toJson(char**); - using GeneralRequest::setHeader; private: