diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-12-29 17:46:17 +0000 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-12-29 17:46:17 +0000 |
commit | 6ba46a717f4e71910891c88fa515cec2762c7ddf (patch) | |
tree | 65430e66ab8ca6e906df8f69bcd0412bd0a08421 /NorthstarDedicatedTest/masterserver.cpp | |
parent | dce1bfc7446ceb2591bee4d4ebdce4a2c5f64bda (diff) | |
download | NorthstarLauncher-6ba46a717f4e71910891c88fa515cec2762c7ddf.tar.gz NorthstarLauncher-6ba46a717f4e71910891c88fa515cec2762c7ddf.zip |
escape password entry request
Diffstat (limited to 'NorthstarDedicatedTest/masterserver.cpp')
-rw-r--r-- | NorthstarDedicatedTest/masterserver.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/NorthstarDedicatedTest/masterserver.cpp b/NorthstarDedicatedTest/masterserver.cpp index caa2877b..c4f576e3 100644 --- a/NorthstarDedicatedTest/masterserver.cpp +++ b/NorthstarDedicatedTest/masterserver.cpp @@ -536,12 +536,19 @@ void MasterServerManager::AuthenticateWithServer(char* uid, char* playerToken, c CURL* curl = curl_easy_init(); std::string readBuffer; - curl_easy_setopt(curl, CURLOPT_URL, fmt::format("{}/client/auth_with_server?id={}&playerToken={}&server={}&password={}", Cvar_ns_masterserver_hostname->m_pszString, uidStr, tokenStr, serverIdStr, passwordStr).c_str()); curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST"); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, CurlWriteToStringBufferCallback); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer); + { + char* escapedPassword = curl_easy_escape(curl, passwordStr.c_str(), passwordStr.length()); + + curl_easy_setopt(curl, CURLOPT_URL, fmt::format("{}/client/auth_with_server?id={}&playerToken={}&server={}&password={}", Cvar_ns_masterserver_hostname->m_pszString, uidStr, tokenStr, serverIdStr, escapedPassword).c_str()); + + curl_free(escapedPassword); + } + CURLcode result = curl_easy_perform(curl); if (result == CURLcode::CURLE_OK) |