diff --git a/csp/start.md b/csp/start.md index eefc450..3aa6865 100644 --- a/csp/start.md +++ b/csp/start.md @@ -42,7 +42,7 @@ var cos = new COS({ ServiceDomain: 'http://cos.default.xxx.com', // 这里替换成 getService 域名 Domain: 'http://{Bucket}.cos.{Region}.xxx.com', 这里替换成 API 域名格式模板 getAuthorization: function (options, callback) { - var url = './auth.php?method=' + options.Method + '&pathname=' + encodeURIComponent(options.Key); + var url = './auth-json.php?method=' + options.Method + '&path=' + encodeURIComponent('/' + options.Key); var xhr = new XMLHttpRequest(); xhr.open('GET', url, true); xhr.onload = function (e) { diff --git a/test/test.js b/test/test.js index 9b77f9a..ed68455 100644 --- a/test/test.js +++ b/test/test.js @@ -634,7 +634,7 @@ group('putObject()', function () { Region: config.Region, Key: filename, }, function (err, data) { - assert.ok(data.Body === content && (data.headers && data.headers.etag) === ETag); + assert.ok(data.Body && data.Body === content && (data.headers && data.headers.etag) === ETag); done(); }); });