Skip to content

Commit 1530ed8

Browse files
committed
Client: add HTTP header for the api client version
1 parent 4489fb9 commit 1530ed8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Client.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
class Client
2121
{
22+
const API_CLIENT_VERSION = '1.21.0';
23+
2224
/** @var HttpPluginClientBuilder */
2325
private $httpClientBuilder;
2426
/** @var ResponseMediator */
@@ -36,6 +38,7 @@ public function __construct(HttpPluginClientBuilder $httpClientBuilder = null, $
3638
$builder->addPlugin(new Plugin\RedirectPlugin());
3739
$builder->addPlugin(new Plugin\HeaderDefaultsPlugin([
3840
'User-Agent' => 'php-private-packagist-api (https://github.com/packagist/private-packagist-api-client)',
41+
'X-API-CLIENT-VERSION' => self::API_CLIENT_VERSION,
3942
]));
4043
$builder->addPlugin(new ExceptionThrower($this->responseMediator));
4144
}

0 commit comments

Comments
 (0)