Make default User-agent follow RFC 2616
authorShadowNinja <shadowninja@minetest.net>
Wed, 15 Jan 2014 16:58:28 +0000 (11:58 -0500)
committerShadowNinja <shadowninja@minetest.net>
Wed, 15 Jan 2014 17:10:53 +0000 (12:10 -0500)
src/httpfetch.cpp

index 2b93ade8b846cf1ca65758a80f5b03aaa783b780..bc029ed7a0df2acbb47709448d4498887fafb2a2 100644 (file)
@@ -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
        }