From: Aki Tuomi Date: Wed, 13 Mar 2019 18:06:09 +0000 (+0200) Subject: remotebackend: http connector - Properly escape parameters X-Git-Tag: auth-4.2.0-rc1~4^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6de3be832cbab7805ab5215dce503d11d8769414;p=thirdparty%2Fpdns.git remotebackend: http connector - Properly escape parameters --- diff --git a/modules/remotebackend/httpconnector.cc b/modules/remotebackend/httpconnector.cc index 950aa27878..7b2487eb15 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 << "&"; }