Skip to content

Commit

Permalink
优化阿里大于短信参数配置 (overtrue#17)
Browse files Browse the repository at this point in the history
* 精简过滤签名getHeadersToSign的方法,headers确定,指定的keys确定,兼容写法可以全部删除。
精简getCanonicalHeaders方法,无空值,兼容代码删除

Signed-off-by: iwzh <[email protected]>

* 优化readme.md 阿里大于配置参数。

Signed-off-by: iwzh <[email protected]>
  • Loading branch information
iwzh authored and overtrue committed Jun 2, 2017
1 parent ad21683 commit e3c142c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ $easySms->send(13188888888, $message);
```php
'alidayu' => [
'app_key' => '',
'app_secret' => '',
'sign_name' => '',
],
```
Expand Down Expand Up @@ -267,6 +268,7 @@ $easySms->send(13188888888, $message);
'ak' => '',
'sk' => '',
'invoke_id' => '',
'domain' => '',
],
```

Expand Down
4 changes: 2 additions & 2 deletions src/Gateways/BaiduGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public function send($to, MessageInterface $message, Config $config)
'x-bce-date' => $datetime,
'x-bce-content-sha256' => hash('sha256', json_encode($params)),
];

$signHeaders = $this->getHeadersToSign($headers, ['host', 'x-bce-content-sha256']); // 获得需要签名的数据
//获得需要签名的数据
$signHeaders = $this->getHeadersToSign($headers, ['host', 'x-bce-content-sha256']);

$headers['Authorization'] = $this->generateSign($signHeaders, $datetime, $config);

Expand Down

0 comments on commit e3c142c

Please sign in to comment.