Skip to content

Commit

Permalink
fix watermark 403 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
tuuna committed Dec 3, 2021
1 parent 1f6fd3f commit 2862ce2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
cos-php-sdk-v5 Upgrade Guide
====================
2.4.3 to 2.4.4
---------
- 修复图片水印签名问题

2.4.2 to 2.4.3
---------
- 优化审核接口返回相关字段
Expand Down
2 changes: 1 addition & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
* @see \Qcloud\Cos\Service::getService()
*/
class Client extends GuzzleClient {
const VERSION = '2.4.3';
const VERSION = '2.4.4';

public $httpClient;

Expand Down
4 changes: 2 additions & 2 deletions src/CommandToRequestTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,9 @@ public function ciParamTransformer( CommandInterface $command, $request ) {
$uri = $request->getUri();
$query = $uri->getQuery();
if($query){
$query .= "&" . $command['ImageHandleParam'];
$query .= "&" . urlencode($command['ImageHandleParam']);
}else{
$query .= $command['ImageHandleParam'];
$query .= urlencode($command['ImageHandleParam']);
}
$uri = $uri->withQuery($query);
$request = $request->withUri( $uri );
Expand Down
2 changes: 1 addition & 1 deletion src/Signature.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function createAuthorization( RequestInterface $request, $expires = '+30
foreach ( explode( '&', $request->getUri()->getQuery() ) as $query ) {
if (!empty($query)) {
$tmpquery = explode( '=', $query );
$key = strtolower( urlencode($tmpquery[0]) );
$key = strtolower( $tmpquery[0] );
if (count($tmpquery) >= 2) {
$value = $tmpquery[1];
} else {
Expand Down

0 comments on commit 2862ce2

Please sign in to comment.