Add User-Agent curl option in download_to_string function. [#438]

This commit is contained in:
Elvis Oric
2019-04-19 14:48:02 +02:00
committed by Howard Hinnant
parent 081e9af55b
commit 429d9ba739

View File

@@ -2810,6 +2810,7 @@ download_to_string(const std::string& url, std::string& str)
if (!curl)
return false;
std::string version;
curl_easy_setopt(curl.get(), CURLOPT_USERAGENT, "curl");
curl_easy_setopt(curl.get(), CURLOPT_URL, url.c_str());
curl_write_callback write_cb = [](char* contents, std::size_t size, std::size_t nmemb,
void* userp) -> std::size_t