Skip to content

Commit bc71a36

Browse files
committed
add version to User-Agent
1 parent 5951a83 commit bc71a36

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/CloudConvert.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
class CloudConvert
1616
{
1717

18+
const VERSION = '3.2.1';
19+
1820
/**
1921
* @var array
2022
*/

src/Transport/HttpTransport.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
namespace CloudConvert\Transport;
55

66

7+
use CloudConvert\CloudConvert;
78
use CloudConvert\Exceptions\HttpClientException;
89
use CloudConvert\Exceptions\HttpServerException;
910
use Http\Client\Common\Plugin\HeaderDefaultsPlugin;
@@ -55,7 +56,7 @@ protected function createHttpClientInstance(): HttpClient
5556
$httpClient = $this->options['http_client'] ?? Psr18ClientDiscovery::find();
5657
$httpClientPlugins = [
5758
new HeaderDefaultsPlugin([
58-
'User-Agent' => 'cloudconvert-php/v3 (https://github.com/cloudconvert/cloudconvert-php)',
59+
'User-Agent' => 'cloudconvert-php/v' . CloudConvert::VERSION . ' (https://github.com/cloudconvert/cloudconvert-php)',
5960
]),
6061
new RedirectPlugin()
6162
];
@@ -191,7 +192,7 @@ public function upload($path, $file, string $fileName = null, array $additionalP
191192
}
192193

193194
$resourceOptions = [];
194-
if($fileName !== null) {
195+
if ($fileName !== null) {
195196
$resourceOptions['filename'] = $fileName;
196197
}
197198
$builder->addResource('file', $file, $resourceOptions);

0 commit comments

Comments
 (0)