@baiducloud/sdk
Advanced tools
Comparing version 1.0.0-rc.30 to 1.0.0-rc.31
# CHANGELOG | ||
## 1.0.0-rc.31(2021-08-13) | ||
### Fix | ||
- BOSClient: add key valiation in getObject() & getObjectToFile() method; | ||
- empty key is not allowed | ||
- consecutive forward slashes (/) are not allowed in key | ||
- forward slash (/) and a backslash (\\) are not allowed at head or tail | ||
- consecutive periods (..) are not allowed in sub-path | ||
## 1.0.0-rc.30(2021-08-03) | ||
@@ -4,0 +12,0 @@ ### Fix |
{ | ||
"name": "@baiducloud/sdk", | ||
"version": "1.0.0-rc.30", | ||
"version": "1.0.0-rc.31", | ||
"description": "Baidu Cloud Engine JavaScript SDK", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
@@ -20,3 +20,3 @@ Baidu Cloud Engine JavaScript SDK | ||
```html | ||
<script src="https://code.bdstatic.com/npm/@baiducloud/sdk@1.0.0-rc.30/dist/baidubce-sdk.bundle.min.js" ></script> | ||
<script src="https://code.bdstatic.com/npm/@baiducloud/sdk@1.0.0-rc.31/dist/baidubce-sdk.bundle.min.js" ></script> | ||
``` |
@@ -508,2 +508,15 @@ /** | ||
BosClient.prototype.getObject = function (bucketName, key, range, options) { | ||
if (!key) { | ||
throw new TypeError('key should not be empty.'); | ||
} | ||
else if (/\/\/+/.test(key)) { | ||
throw new TypeError('key should not contain consecutive forward slashes (/).'); | ||
} | ||
else if (/^[/\\]/.test(key) || /[/\\]$/.test(key)) { | ||
throw new TypeError('key should not start or end with a forward slash (/) or a backslash (\\).'); | ||
} | ||
else if (/\/\.\.\//.test(key)) { | ||
throw new TypeError('path in key should not contain consecutive periods (..).'); | ||
} | ||
options = options || {}; | ||
@@ -527,2 +540,15 @@ | ||
BosClient.prototype.getObjectToFile = function (bucketName, key, filename, range, options) { | ||
if (!key) { | ||
throw new TypeError('key should not be empty.'); | ||
} | ||
else if (/\/\/+/.test(key)) { | ||
throw new TypeError('key should not contain consecutive forward slashes (/).'); | ||
} | ||
else if (/^[/\\]/.test(key) || /[/\\]$/.test(key)) { | ||
throw new TypeError('key should not start or end with a forward slash (/) or a backslash (\\).'); | ||
} | ||
else if (/\/\.\.\//.test(key)) { | ||
throw new TypeError('path in key should not contain consecutive periods (..).'); | ||
} | ||
options = options || {}; | ||
@@ -529,0 +555,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2921675
58813