Move URL escaping to Inspector layer

Reviewed By: Hypuk

Differential Revision: D5967544

fbshipit-source-id: d741e6324aff7583778cb13c862505b61ca02a3d
This commit is contained in:
Paco Estevez Garcia
2017-10-04 03:32:14 -07:00
committed by Facebook Github Bot
parent eae4fe810f
commit ef2e29f54c
4 changed files with 16 additions and 11 deletions

View File

@@ -17,6 +17,7 @@
#include <folly/Exception.h>
#include <folly/json.h>
#include <folly/Memory.h>
#include <folly/String.h>
#include <glog/logging.h>
#include <jschelpers/InspectorInterfaces.h>
#include <jschelpers/JSCHelpers.h>
@@ -295,10 +296,13 @@ namespace facebook {
#endif //defined(__ANDROID__)
}
std::string escapedOwner = folly::uriEscape<std::string>(owner, folly::UriEscapeMode::QUERY);
std::string escapedApp = folly::uriEscape<std::string>(app, folly::UriEscapeMode::QUERY);
std::string escapedDevice = folly::uriEscape<std::string>(device, folly::UriEscapeMode::QUERY);
std::string msg = folly::to<std::string>(
"GET /autoattach?title=", owner,
"&app=" , app,
"&device=" , device,
"GET /autoattach?title=", escapedOwner,
"&app=" , escapedApp,
"&device=" , escapedDevice,
" HTTP/1.1\r\n\r\n");
auto send_resp = ::send(socket_desc, msg.c_str(), msg.length(), 0);
if (send_resp < 0) {