Skip to content

Commit

Permalink
Fixed #2622
Browse files Browse the repository at this point in the history
  • Loading branch information
overtrue committed Nov 28, 2022
1 parent 9018cb6 commit 6b04ca3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Pay/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,13 @@ public function request(string $method, string $url, array $options = []): Respo

$options['headers']['User-Agent'] = UserAgent::create();

if ($this->isV3Request($url) && empty($options['headers']['Authorization'])) {
if ($this->isV3Request($url)) {
[, $_options] = $this->prepareRequest($method, $url, $options, $this->defaultOptions, true);

$options['headers']['Authorization'] = $this->createSignature($method, $url, $_options);
// 部分签名算法需要使用到 body 中额外的部分,所以交由前置逻辑自行完成
if (empty($options['headers']['Authorization'])) {
$options['headers']['Authorization'] = $this->createSignature($method, $url, $_options);
}
} else {
// v2 全部为 xml 请求
if (! empty($options['xml'])) {
Expand Down

0 comments on commit 6b04ca3

Please sign in to comment.