From 8903c68460d79aeac6b1c5074003743f98371339 Mon Sep 17 00:00:00 2001 From: proller Date: Tue, 5 Nov 2013 16:57:43 +0400 Subject: Correct useragent in http queries Net struct init --- src/convert_json.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/convert_json.cpp') diff --git a/src/convert_json.cpp b/src/convert_json.cpp index edb37024c..e8eede0b1 100644 --- a/src/convert_json.cpp +++ b/src/convert_json.cpp @@ -27,6 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "log.h" #include "main.h" // for g_settings #include "settings.h" +#include "version.h" #if USE_CURL #include @@ -56,6 +57,7 @@ Json::Value fetchJsonValue(const std::string url, curl_easy_setopt(curl, CURLOPT_WRITEDATA, &liststring); curl_easy_setopt(curl, CURLOPT_TIMEOUT_MS, g_settings->getS32("curl_timeout")); curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT_MS, g_settings->getS32("curl_timeout")); + curl_easy_setopt(curl, CURLOPT_USERAGENT, (std::string("Minetest ")+minetest_version_hash).c_str()); if (chunk != 0) curl_easy_setopt(curl, CURLOPT_HTTPHEADER, chunk); -- cgit v1.2.3