Send user agent when fetching

(cherry picked from commit b0a93f01c5)
This commit is contained in:
Anatol Belski
2018-02-20 10:34:30 +01:00
parent 14caf075b4
commit aa3cc57bfd
2 changed files with 6 additions and 0 deletions
+5
View File
@@ -376,6 +376,11 @@ class Config
return $path;
}/*}}}*/
public static function getSdkUserAgentName() : string
{/*{{{*/
return "PHP-SDK-BINARY-TOOLS/" . self::getSdkVersion();
}/*}}}*/
}
/*
+1
View File
@@ -131,6 +131,7 @@ trait FileOps
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_USERAGENT, Config::getSdkUserAgentName());
$ret = curl_exec($ch);
if (false === $ret) {