Skip to content

Commit 8a9988e

Browse files
authored
Merge pull request #5 from petfinder-com/feature/sdk-usage-header
update header used to track sdk usage
2 parents f7b4229 + 8b1cd43 commit 8a9988e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Http/Builder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function __construct(
4444
) {
4545
$this->http = $httpClient ?? HttpAsyncClientDiscovery::find();
4646
$this->requestFactory = $requestFactory ?? MessageFactoryDiscovery::find();
47-
$this->headers['User-Agent'] = 'petfinder-php-sdk/v1.0 (https://github.com/petfinder-com/petfinder-php-sdk)';
47+
$this->headers['X-Api-Sdk'] = 'petfinder-php-sdk/v1.0 (https://github.com/petfinder-com/petfinder-php-sdk)';
4848
}
4949

5050
public function getHttpClient(): HttpAsyncClient

tests/Http/BuilderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public function testHeaders(): void
120120
$this->builder->getHttpClient()->sendAsyncRequest(new Request('GET', '/test'));
121121
$this->assertEquals('bar', $this->http->getLastRequest()->getHeaderLine('X-Foo'));
122122
$this->assertEquals('foo', $this->http->getLastRequest()->getHeaderLine('X-Bar'));
123-
$this->assertEquals('petfinder-php-sdk/v1.0 (https://github.com/petfinder-com/petfinder-php-sdk)', $this->http->getLastRequest()->getHeaderLine('User-Agent'));
123+
$this->assertEquals('petfinder-php-sdk/v1.0 (https://github.com/petfinder-com/petfinder-php-sdk)', $this->http->getLastRequest()->getHeaderLine('X-Api-Sdk'));
124124

125125
$this->builder->addHeaders(['X-Baz' => 'baz']);
126126

0 commit comments

Comments
 (0)