mirror of
https://github.com/guzzle/guzzle.git
synced 2025-03-14 19:29:49 +01:00
Dont show curl version in user agent (#2654)
* Dont show curl version in user agent * Fixed tests * Add back the fynction * Drop "version" part * added version
This commit is contained in:
parent
d2db8f533d
commit
41d72a8b32
@ -107,17 +107,7 @@ final class Utils
|
||||
*/
|
||||
public static function defaultUserAgent(): string
|
||||
{
|
||||
static $defaultAgent = '';
|
||||
|
||||
if (!$defaultAgent) {
|
||||
$defaultAgent = 'GuzzleHttp/Guzzle';
|
||||
if (\extension_loaded('curl') && \function_exists('curl_version')) {
|
||||
$defaultAgent .= ' curl/' . \curl_version()['version'];
|
||||
}
|
||||
$defaultAgent .= ' PHP/' . PHP_VERSION;
|
||||
}
|
||||
|
||||
return $defaultAgent;
|
||||
return sprintf('GuzzleHttp/%d', ClientInterface::MAJOR_VERSION);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -11,12 +11,6 @@ class FunctionsTest extends TestCase
|
||||
return [['get'], ['head'], ['delete']];
|
||||
}
|
||||
|
||||
public function testProvidesDefaultUserAgent()
|
||||
{
|
||||
$ua = GuzzleHttp\default_user_agent();
|
||||
self::assertRegExp('#^GuzzleHttp/.+ curl/.+ PHP/.+$#', $ua);
|
||||
}
|
||||
|
||||
public function typeProvider()
|
||||
{
|
||||
return [
|
||||
|
Loading…
x
Reference in New Issue
Block a user