Skip to content

Commit

Permalink
Make default User-agent follow RFC 2616
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadowNinja committed Jan 15, 2014
1 parent a5287b6 commit f42f017
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/httpfetch.cpp
Expand Up @@ -50,13 +50,14 @@ std::map<unsigned long, std::list<HTTPFetchResult> > g_httpfetch_results;
timeout = g_settings->getS32("curl_timeout");
connect_timeout = timeout * 5;

useragent = std::string("Minetest ") + minetest_version_hash;
useragent = std::string("Minetest/") + minetest_version_hash + " ";
#ifdef _WIN32
useragent += "Windows";
useragent += "(Windows)";
#else
struct utsname osinfo;
uname(&osinfo);
useragent += std::string(" (") + osinfo.sysname + "; " + osinfo.release + "; " + osinfo.machine + ")";
useragent += std::string("(") + osinfo.sysname + "/"
+ osinfo.release + " " + osinfo.machine + ")";
#endif
}

Expand Down

0 comments on commit f42f017

Please sign in to comment.