diff --git a/application/utils.inc.php b/application/utils.inc.php index 41bf97c6d..1f0d063e9 100644 --- a/application/utils.inc.php +++ b/application/utils.inc.php @@ -1944,7 +1944,7 @@ SQL; CURLOPT_HEADER => false, // don't return the headers in the output CURLOPT_FOLLOWLOCATION => true, // follow redirects CURLOPT_ENCODING => "", // handle all encodings - CURLOPT_USERAGENT => "spider", // who am i + CURLOPT_USERAGENT => static::GetConfig()->Get('http.request.user_agent'), // who am i CURLOPT_AUTOREFERER => true, // set referer on redirect CURLOPT_CONNECTTIMEOUT => 120, // timeout on connect CURLOPT_TIMEOUT => 120, // timeout on response diff --git a/core/config.class.inc.php b/core/config.class.inc.php index 7da2881c5..3534f7588 100644 --- a/core/config.class.inc.php +++ b/core/config.class.inc.php @@ -1795,6 +1795,13 @@ class Config 'source_of_value' => '', 'show_in_conf_sample' => false, ], + 'http.request.user_agent' => [ + 'type' => 'string', + 'description' => 'HTTP request user agent, use this to set a custom agent on external requests.', + 'default' => ITOP_APPLICATION.'/'.ITOP_VERSION, + 'source_of_value' => '', + 'show_in_conf_sample' => false, + ] ]; public function IsProperty($sPropCode)