Skip to content

Commit

Permalink
add version to User-Agent
Browse files Browse the repository at this point in the history
  • Loading branch information
josiasmontag committed Feb 12, 2021
1 parent 5951a83 commit bc71a36
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/CloudConvert.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
class CloudConvert
{

const VERSION = '3.2.1';

/**
* @var array
*/
Expand Down
5 changes: 3 additions & 2 deletions src/Transport/HttpTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
namespace CloudConvert\Transport;


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

$resourceOptions = [];
if($fileName !== null) {
if ($fileName !== null) {
$resourceOptions['filename'] = $fileName;
}
$builder->addResource('file', $file, $resourceOptions);
Expand Down

0 comments on commit bc71a36

Please sign in to comment.