Skip to content

Commit

Permalink
修改用例
Browse files Browse the repository at this point in the history
  • Loading branch information
carsonxu committed Nov 22, 2018
1 parent 77ba2d7 commit b37b0a9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ <h2 id="qunit-banner"></h2>

<script src="./qunit-2.4.0.js"></script>
<script src="../dist/cos-js-sdk-v5.js"></script>
<script src="../demo/common/cos-auth.min.js"></script>
<script src="./test.js"></script>

</body>
Expand Down
15 changes: 13 additions & 2 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var config = {
Bucket: 'test-1250000000',
Bucket: 'test-1251902136',
Region: 'ap-guangzhou'
};

Expand Down Expand Up @@ -28,6 +28,7 @@ var util = {
};

var getAuthorization = function (options, callback) {

var url = '../server/sts.php';
var xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
Expand All @@ -44,6 +45,16 @@ var getAuthorization = function (options, callback) {
});
};
xhr.send();

// var auth = CosAuth({
// Version: '4.0',
// SecretId: 'xxx',
// SecretKey: 'xxx',
// Bucket: config.Bucket,
// Expires: 900,
// Pathname: '/' + (options.Headers && options.Headers['x-cos-copy-source'] ? '' : options.Key),
// });
// callback({Authorization: auth});
};
var dataURItoUploadBody = function (dataURI) {
var byteString = atob(dataURI.split(',')[1]);
Expand Down Expand Up @@ -722,7 +733,7 @@ group('putObjectCopy() 1', function () {
Region: config.Region,
Key: '1.copy.txt',
}, function (err, data) {
assert.ok(data.headers.etag === ETag, '成功复制文件');
assert.ok(data.headers && data.headers.etag === ETag, '成功复制文件');
done();
});
});
Expand Down

0 comments on commit b37b0a9

Please sign in to comment.