Skip to content

Commit

Permalink
Merge pull request #114 from hhxsv5/master
Browse files Browse the repository at this point in the history
support custom HTTP configuration
  • Loading branch information
hhxsv5 authored Oct 25, 2021
2 parents 947cf9d + c767a5f commit 99436ca
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ abstract class Api
/**
* @var string SDK Version
*/
const VERSION = '1.1.22';
const VERSION = '1.1.23';

/**
* @var string SDK update date
*/
const UPDATE_DATE = '2021.08.02';
const UPDATE_DATE = '2021.10.25';

/**
* @var string
Expand Down
12 changes: 6 additions & 6 deletions src/Http/GuzzleHttp.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ public function request(Request $request, $timeout = 30)
}

$config = [
'base_uri' => $request->getBaseUri(),
'timeout' => $timeout,
'connect_timeout' => 30,
'http_errors' => false,
'verify' => empty($this->config['skipVerifyTls']),
];
'base_uri' => $request->getBaseUri(),
'timeout' => $timeout,
'connect_timeout' => 30,
'http_errors' => false,
'verify' => isset($this->config['verify']) ? $this->config['verify'] : empty($this->config['skipVerifyTls']),
] + $this->config;
$client = static::getClient($config);
$options = [
'headers' => $request->getHeaders(),
Expand Down
10 changes: 5 additions & 5 deletions src/Http/SwooleHttp.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ public function request(Request $request, $timeout = 30)
}

$config = [
'base_uri' => $request->getBaseUri(),
'timeout' => $timeout,
'use_pool' => true,
'ssl_verify_peer' => empty($this->config['skipVerifyTls']),
];
'base_uri' => $request->getBaseUri(),
'timeout' => $timeout,
'use_pool' => true,
'ssl_verify_peer' => isset($this->config['ssl_verify_peer']) ? $this->config['ssl_verify_peer'] : empty($this->config['skipVerifyTls']),
] + $this->config;
$client = static::getClient($config);
$options['headers'] = $request->getHeaders();

Expand Down

0 comments on commit 99436ca

Please sign in to comment.