Skip to content

Commit b4a3cbb

Browse files
authored
Fix signHost type error (#265)
1 parent 5ecce9a commit b4a3cbb

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/Client.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public function __construct(array $cosConfig) {
177177
return $request->withHeader('User-Agent', $this->cosConfig['userAgent']);
178178
}));
179179
if ($this->cosConfig['anonymous'] != true) {
180-
$handler->push($this::handleSignature($this->cosConfig['secretId'], $this->cosConfig['secretKey'], $this->cosConfig['signHost']));
180+
$handler->push($this::handleSignature($this->cosConfig['secretId'], $this->cosConfig['secretKey'], $this->cosConfig));
181181
}
182182
if ($this->cosConfig['token'] != null) {
183183
$handler->push(Middleware::mapRequest(function (RequestInterface $request) {
@@ -484,9 +484,9 @@ public static function explodeKey($key) {
484484
}
485485

486486

487-
public static function handleSignature($secretId, $secretKey, $signHost) {
488-
return function (callable $handler) use ($secretId, $secretKey, $signHost) {
489-
return new SignatureMiddleware($handler, $secretId, $secretKey, $signHost);
487+
public static function handleSignature($secretId, $secretKey, $options) {
488+
return function (callable $handler) use ($secretId, $secretKey, $options) {
489+
return new SignatureMiddleware($handler, $secretId, $secretKey, $options);
490490
};
491491
}
492492

src/Signature.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Signature {
1111
// string: secret key.
1212
private $secretKey;
1313

14-
// bool: host trigger
14+
// array: cos config.
1515
private $options;
1616

1717
public function __construct( $accessKey, $secretKey, $options, $token = null ) {

src/SignatureMiddleware.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ class SignatureMiddleware {
1111
/**
1212
* @param callable $nextHandler Next handler to invoke.
1313
*/
14-
public function __construct(callable $nextHandler, $accessKey, $secretKey, $signHost) {
14+
public function __construct(callable $nextHandler, $accessKey, $secretKey, $options) {
1515
$this->nextHandler = $nextHandler;
16-
$this->signature = new Signature($accessKey, $secretKey, $signHost);
16+
$this->signature = new Signature($accessKey, $secretKey, $options);
1717
}
1818

1919
public function __invoke(RequestInterface $request, array $options) {

0 commit comments

Comments
 (0)