Skip to content

Commit abf34f8

Browse files
authored
Merge pull request #311 from qiniu/develop
update CdnManager.php
2 parents afe7d87 + c1867c2 commit abf34f8

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

.travis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ php:
77
- 5.6
88
- 7.0
99

10+
dist: trusty
11+
1012
before_script:
1113
- export QINIU_TEST_ENV="travis"
1214
- travis_retry composer self-update

src/Qiniu/Cdn/CdnManager.php

+2-9
Original file line numberDiff line numberDiff line change
@@ -170,23 +170,16 @@ private function post($url, $body)
170170
public static function createTimestampAntiLeechUrl($rawUrl, $encryptKey, $durationInSeconds)
171171
{
172172
$parsedUrl = parse_url($rawUrl);
173-
174173
$deadline = time() + $durationInSeconds;
175174
$expireHex = dechex($deadline);
176-
177175
$path = isset($parsedUrl['path']) ? $parsedUrl['path'] : '';
178-
$path = implode('/', array_map('rawurlencode', explode('/', $path)));
179176
$strToSign = $encryptKey . $path . $expireHex;
180177
$signStr = md5($strToSign);
181-
182-
$url = $parsedUrl['scheme'].'://'.$parsedUrl['host'].$path;
183-
184178
if (isset($parsedUrl['query'])) {
185-
$signedUrl = $url . '&sign=' . $signStr . '&t=' . $expireHex;
179+
$signedUrl = $rawUrl . '&sign=' . $signStr . '&t=' . $expireHex;
186180
} else {
187-
$signedUrl = $url . '?sign=' . $signStr . '&t=' . $expireHex;
181+
$signedUrl = $rawUrl . '?sign=' . $signStr . '&t=' . $expireHex;
188182
}
189-
190183
return $signedUrl;
191184
}
192185
}

src/Qiniu/Config.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
final class Config
55
{
6-
const SDK_VER = '7.2.9';
6+
const SDK_VER = '7.2.10';
77

88
const BLOCK_SIZE = 4194304; //4*1024*1024 分块上传块大小,该参数为接口规格,不能修改
99

0 commit comments

Comments
 (0)