Skip to content

Commit

Permalink
fixed roa request error; signature repeat
Browse files Browse the repository at this point in the history
  • Loading branch information
AxiosLeo committed Jun 12, 2019
1 parent 39c982a commit 720241f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 3 additions & 0 deletions library/core/credentials/RoaCredential.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

use aliyun\sdk\Aliyun;
use aliyun\sdk\core\exception\UnsupportedRegionIdException;
use aliyun\sdk\core\help\SignatureNonce;
use aliyun\sdk\core\lib\Request;
use aliyun\sdk\core\sign\RoaSignature;

Expand All @@ -37,6 +38,8 @@ public function init(Request &$request): void
throw new UnsupportedRegionIdException($request->product(), $request->region(), $request->endpoints());
}

$request->params("signature-nonce", SignatureNonce::get("SignatureNonce"));

foreach ($request->params() as $key => $value) {
$request->headers($header_prefix . $key, $value);
}
Expand Down
2 changes: 0 additions & 2 deletions library/core/lib/RoaRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@
namespace aliyun\sdk\core\lib;

use aliyun\sdk\Aliyun;
use aliyun\sdk\core\help\SignatureNonce;

class RoaRequest extends Request
{
public function __construct()
{
$this->region = Aliyun::region();
$this->params("signature-method", "HMAC-SHA1");
$this->params("signature-nonce", SignatureNonce::get("SignatureNonce"));
$this->params("signature-version", "1.0");
}

Expand Down

0 comments on commit 720241f

Please sign in to comment.