Fixed: Send user-agent string and cookies with image request.

This commit is contained in:
Nimetu 2016-05-25 12:08:12 +03:00
parent 60e40efe9d
commit 0e748551e1

View file

@ -316,6 +316,11 @@ namespace NLGUI
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, true); curl_easy_setopt(curl, CURLOPT_NOPROGRESS, true);
curl_easy_setopt(curl, CURLOPT_URL, finalUrl.c_str()); curl_easy_setopt(curl, CURLOPT_URL, finalUrl.c_str());
std::string userAgent = options.appName + "/" + options.appVersion;
curl_easy_setopt(curl, CURLOPT_USERAGENT, userAgent.c_str());
sendCookies(curl, _DocumentDomain, _TrustedDomain);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp); curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, fwrite); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, fwrite);