From 4f3c2b32894bcc5fb394c32d23a58f4ea2ec025f Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Wed, 13 Mar 2019 20:06:09 +0200 Subject: [PATCH] remotebackend: http connector - Properly escape parameters (cherry picked from commit 6de3be832cbab7805ab5215dce503d11d8769414) --- modules/remotebackend/httpconnector.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/remotebackend/httpconnector.cc b/modules/remotebackend/httpconnector.cc index a154da134..7974c557c 100644 --- a/modules/remotebackend/httpconnector.cc +++ b/modules/remotebackend/httpconnector.cc @@ -71,7 +71,7 @@ HTTPConnector::~HTTPConnector() { void HTTPConnector::addUrlComponent(const Json ¶meters, const string& element, std::stringstream& ss) { std::string sparam; if (parameters[element] != Json()) - ss << "/" << asString(parameters[element]); + ss << "/" << YaHTTP::Utility::encodeURL(asString(parameters[element]), false); } std::string HTTPConnector::buildMemberListArgs(std::string prefix, const Json& args) { @@ -81,9 +81,9 @@ std::string HTTPConnector::buildMemberListArgs(std::string prefix, const Json& a if (pair.second.is_bool()) { stream << (pair.second.bool_value()?"1":"0"); } else if (pair.second.is_null()) { - stream << prefix << "[" << pair.first << "]="; + stream << prefix << "[" << YaHTTP::Utility::encodeURL(pair.first, false) << "]="; } else { - stream << prefix << "[" << pair.first << "]=" << this->asString(pair.second); + stream << prefix << "[" << YaHTTP::Utility::encodeURL(pair.first, false) << "]=" << YaHTTP::Utility::encodeURL(this->asString(pair.second), false); } stream << "&"; } -- 2.40.0