From 5e30390f4a480413c5714ded246472c86382189a Mon Sep 17 00:00:00 2001 From: Ted John Date: Mon, 29 Aug 2016 19:25:53 +0100 Subject: [PATCH] Set user agent for HTTP requests --- src/network/http.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/network/http.cpp b/src/network/http.cpp index 49878ceb4d..b54ab01f5f 100644 --- a/src/network/http.cpp +++ b/src/network/http.cpp @@ -38,6 +38,7 @@ void http_dispose() { } #define MIME_TYPE_APPLICATION_JSON "application/json" #define DEFAULT_CA_BUNDLE_PATH "curl-ca-bundle.crt" +#define OPENRCT2_USER_AGENT "OpenRCT2/" OPENRCT2_VERSION typedef struct read_buffer { char *ptr; @@ -150,6 +151,7 @@ http_json_response *http_request_json(const http_json_request *request) curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, true); curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, true); + curl_easy_setopt(curl, CURLOPT_USERAGENT, OPENRCT2_USER_AGENT); #ifdef __WINDOWS__ // On GNU/Linux (and macOS), curl will use the system certs by default curl_easy_setopt(curl, CURLOPT_CAINFO, _caBundlePath);