Skip to content

Commit 628b418

Browse files
authored
Merge pull request #281 from rwifeng/develop
fix timestamp anti bug
2 parents bc9cc93 + 03a0ef9 commit 628b418

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/Qiniu/Cdn/CdnManager.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ public static function createTimestampAntiLeechUrl($rawUrl, $encryptKey, $durati
175175
$deadline = time() + $durationInSeconds;
176176
$expireHex = dechex($deadline);
177177
$path = isset($parsedUrl['path']) ? $parsedUrl['path'] : '';
178+
$path = implode('/', array_map('rawurlencode', explode('/', $path)));
178179

179180
$strToSign = $encryptKey . $path . $expireHex;
180181
$signStr = md5($strToSign);

tests/Qiniu/Tests/ResumeUpTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function test4ML()
3535
public function test4ML2()
3636
{
3737
$key = 'resumePutFile4ML';
38-
$zone = new Zone(array('up.fake.qiniu.com'), array('up.qiniup.com'));
38+
$zone = new Zone(array('up.qiniup.com'));
3939
$cfg = new Config($zone);
4040
$upManager = new UploadManager($cfg);
4141
$token = $this->auth->uploadToken($this->bucketName, $key);

0 commit comments

Comments
 (0)