kopia lustrzana https://gitlab.com/tomaszg/geostat
Escape username in CURL requests
rodzic
8c2d633a51
commit
1c5f7bfe98
|
@ -253,7 +253,9 @@ void Okapi::update_caches(Caches& cc) const {
|
||||||
|
|
||||||
std::string Okapi::get_uuid(const std::string& username) const {
|
std::string Okapi::get_uuid(const std::string& username) const {
|
||||||
std::string service = url + OKAPI_username;
|
std::string service = url + OKAPI_username;
|
||||||
std::string query = "consumer_key=" + key + "&username=" + username + "&fields=uuid";
|
char* user_esc = curl_easy_escape(curl, username.c_str(), username.size()) ;
|
||||||
|
std::string query = "consumer_key=" + key + "&username=" + user_esc + "&fields=uuid";
|
||||||
|
curl_free(user_esc);
|
||||||
curl_post(service, query);
|
curl_post(service, query);
|
||||||
json j = json::parse(curl_output);
|
json j = json::parse(curl_output);
|
||||||
return j["uuid"];
|
return j["uuid"];
|
||||||
|
|
Ładowanie…
Reference in New Issue