Skip to content

Commit

Permalink
fix(BosClient): object鉴权接口生成的链接缺少/前缀; bump: 1.0.0-rc.30
Browse files Browse the repository at this point in the history
  • Loading branch information
lurunze1226 committed Aug 3, 2021
1 parent 33ed9d1 commit d6e9e6b
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 12 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# CHANGELOG

## 1.0.0-rc.30(2021-08-03)
### Fix
- BOSClient: fix issue of lack of '/' prefix of object url;

## 1.0.0-rc.29(2021-08-03)
### Feature
- BOSClient: support "config.removeVersionPrefix"(boolean) parameter to dynamic control 'v1' prefix of resource in generatePresignedUrl, generateUrl;

## 1.0.0-rc.28(2021-03-26)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ Baidu Cloud Engine JavaScript SDK

## 通过CDN引用
```html
<script src="https://code.bdstatic.com/npm/@baiducloud/sdk@1.0.0-rc.29/dist/baidubce-sdk.bundle.min.js" ></script>
<script src="https://code.bdstatic.com/npm/@baiducloud/sdk@1.0.0-rc.30/dist/baidubce-sdk.bundle.min.js" ></script>
```
8 changes: 4 additions & 4 deletions dist/baidubce-sdk.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -44710,7 +44710,7 @@ exports.createContext = Script.createContext = function (context) {
},{"indexof":134}],208:[function(require,module,exports){
module.exports={
"name": "@baiducloud/sdk",
"version": "1.0.0-rc.29",
"version": "1.0.0-rc.30",
"description": "Baidu Cloud Engine JavaScript SDK",
"main": "./index.js",
"browser": {
Expand Down Expand Up @@ -45728,7 +45728,7 @@ BosClient.prototype.generatePresignedUrl = function (bucketName, key, timestamp,
params = params || {};

var resource = path.normalize(path.join(
config.removeVersionPrefix ? '' : '/v1',
config.removeVersionPrefix ? '/' : '/v1',
/\.[\w\-]+\.bcebos\.com$/.test(config.endpoint) ? '' : strings.normalize(bucketName || ''),
strings.normalize(key || '', false)
)).replace(/\\/g, '/');
Expand All @@ -45750,7 +45750,7 @@ BosClient.prototype.generatePresignedUrl = function (bucketName, key, timestamp,
BosClient.prototype.generateUrl = function (bucketName, key, pipeline, cdn, config) {
config = u.extend({}, this.config, config);
var resource = path.normalize(path.join(
config.removeVersionPrefix ? '' : '/v1',
config.removeVersionPrefix ? '/' : '/v1',
strings.normalize(bucketName || ''),
strings.normalize(key || '', false)
)).replace(/\\/g, '/');
Expand Down Expand Up @@ -46630,7 +46630,7 @@ BosClient.prototype.sendRequest = function (httpMethod, varArgs) {

var config = u.extend({}, this.config, args.config);
var resource = path.normalize(path.join(
args.removeVersionPrefix ? '' : '/v1',
args.removeVersionPrefix ? '/' : '/v1',
/\.[\w\-]+\.bcebos\.com$/.test(config.endpoint) ? '' : strings.normalize(args.bucketName || ''),
strings.normalize(args.key || '', false)
)).replace(/\\/g, '/');
Expand Down
4 changes: 2 additions & 2 deletions dist/baidubce-sdk.bundle.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@baiducloud/sdk",
"version": "1.0.0-rc.29",
"version": "1.0.0-rc.30",
"description": "Baidu Cloud Engine JavaScript SDK",
"main": "./index.js",
"browser": {
Expand Down
6 changes: 3 additions & 3 deletions src/bos_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ BosClient.prototype.generatePresignedUrl = function (bucketName, key, timestamp,
params = params || {};

var resource = path.normalize(path.join(
config.removeVersionPrefix ? '' : '/v1',
config.removeVersionPrefix ? '/' : '/v1',
/\.[\w\-]+\.bcebos\.com$/.test(config.endpoint) ? '' : strings.normalize(bucketName || ''),
strings.normalize(key || '', false)
)).replace(/\\/g, '/');
Expand All @@ -117,7 +117,7 @@ BosClient.prototype.generatePresignedUrl = function (bucketName, key, timestamp,
BosClient.prototype.generateUrl = function (bucketName, key, pipeline, cdn, config) {
config = u.extend({}, this.config, config);
var resource = path.normalize(path.join(
config.removeVersionPrefix ? '' : '/v1',
config.removeVersionPrefix ? '/' : '/v1',
strings.normalize(bucketName || ''),
strings.normalize(key || '', false)
)).replace(/\\/g, '/');
Expand Down Expand Up @@ -997,7 +997,7 @@ BosClient.prototype.sendRequest = function (httpMethod, varArgs) {

var config = u.extend({}, this.config, args.config);
var resource = path.normalize(path.join(
args.removeVersionPrefix ? '' : '/v1',
args.removeVersionPrefix ? '/' : '/v1',
/\.[\w\-]+\.bcebos\.com$/.test(config.endpoint) ? '' : strings.normalize(args.bucketName || ''),
strings.normalize(args.key || '', false)
)).replace(/\\/g, '/');
Expand Down

0 comments on commit d6e9e6b

Please sign in to comment.