Skip to content

Commit 35e873d

Browse files
committed
URL encode app name
1 parent 0b8d85e commit 35e873d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

auth.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,15 @@ void KeyAuth::api::init()
8787
enckey = sentKey + XorStr("-") + secret;
8888

8989
std::string hash = checksum();
90+
CURL* curl = curl_easy_init();
9091
auto data =
9192
XorStr("type=init") +
9293
XorStr("&ver=") + version +
9394
XorStr("&hash=") + hash +
9495
XorStr("&enckey=") + sentKey +
95-
XorStr("&name=") + name +
96+
XorStr("&name=") + curl_easy_escape(curl, name.c_str(), 0) +
9697
XorStr("&ownerid=") + ownerid;
98+
curl_easy_cleanup(curl);
9799

98100
auto response = req(data, url);
99101

0 commit comments

Comments
 (0)