Skip to content

Commit

Permalink
Merge pull request #12 from wowiwj/add-secret
Browse files Browse the repository at this point in the history
fix sign not match
  • Loading branch information
wowiwj authored Nov 28, 2019
2 parents 14ebfaf + 8cb7bc1 commit bf664c6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/HttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function getRobotUrl()
$timestamp = time() . sprintf('%03d', rand(1, 999));
$sign = hash_hmac('sha256', $timestamp . "\n" . $secret, $secret, true);
$query['timestamp'] = $timestamp;
$query['sign'] = urlencode(base64_encode($sign));
$query['sign'] = base64_encode($sign);
}
return $this->hookUrl . "?" . http_build_query($query);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function setUp(){
$robot1['timeout'] = 30.0;
$robot1['enabled'] = true;
$robot1['token'] = $token;

$robot1['secret'] = 'SECcfc6343d91e588d1f83dcf6d725a0208f79607726560ca2be135b437c62523b5';
$config['default'] = $robot1;

$this->config = $config;
Expand Down

0 comments on commit bf664c6

Please sign in to comment.