mirror of
https://github.com/benapetr/stikkit.git
synced 2025-04-26 04:51:09 -05:00
Add version in useragent
This commit is contained in:
parent
62b1a0fa0d
commit
e6ab4d245c
@ -123,10 +123,12 @@ int main(int argc, char *argv[])
|
|||||||
post += "&private=1";
|
post += "&private=1";
|
||||||
if (Stikkit::Configuration::Expiry != "0")
|
if (Stikkit::Configuration::Expiry != "0")
|
||||||
post += "&expire=" + Stikkit::Configuration::Expiry;
|
post += "&expire=" + Stikkit::Configuration::Expiry;
|
||||||
|
string useragent;
|
||||||
|
useragent = "Stikkit " + Stikkit::Configuration::Version + " (https://github.com/benapetr/stikkit/)";
|
||||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
|
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
|
||||||
curl_easy_setopt(curl, CURLOPT_URL, Stikkit::Configuration::URL.c_str());
|
curl_easy_setopt(curl, CURLOPT_URL, Stikkit::Configuration::URL.c_str());
|
||||||
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, post.c_str());
|
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, post.c_str());
|
||||||
curl_easy_setopt(curl, CURLOPT_USERAGENT, "stikkit");
|
curl_easy_setopt(curl, CURLOPT_USERAGENT, useragent.c_str());
|
||||||
|
|
||||||
/* Perform the request, res will get the return HTTP code */
|
/* Perform the request, res will get the return HTTP code */
|
||||||
res = curl_easy_perform(curl);
|
res = curl_easy_perform(curl);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user