Comparing version 6.18.0 to 6.18.1
@@ -1,1 +0,1 @@ | ||
exports.version = '6.18.0'; | ||
exports.version = '6.18.1'; |
@@ -226,4 +226,11 @@ const debug = require('debug')('ali-oss'); | ||
if (err.name === 'ResponseTimeoutError') { | ||
err.message = `${err.message.split(',')[0]}, please increase the timeout or use multipartDownload.`; | ||
err.message = `${ | ||
err.message.split(',')[0] | ||
}, please increase the timeout, see more details at https://github.com/ali-sdk/ali-oss#responsetimeouterror`; | ||
} | ||
if (err.name === 'ConnectionTimeoutError') { | ||
err.message = `${ | ||
err.message.split(',')[0] | ||
}, please increase the timeout or reduce the partSize, see more details at https://github.com/ali-sdk/ali-oss#connectiontimeouterror`; | ||
} | ||
throw err; | ||
@@ -230,0 +237,0 @@ } |
@@ -239,6 +239,3 @@ const copy = require('copy-to'); | ||
opt.headers = opt.headers || {}; | ||
opt.headers = { | ||
...opt.headers, | ||
'Content-Length': data.size | ||
}; | ||
opt.headers['Content-Length'] = data.size; | ||
@@ -245,0 +242,0 @@ // Uploading shards does not require x-oss server side encryption |
@@ -0,1 +1,2 @@ | ||
const { checkEnv } = require('../utils/checkEnv'); | ||
const proto = exports; | ||
@@ -10,2 +11,5 @@ /** | ||
proto.head = async function head(name, options = {}) { | ||
checkEnv( | ||
'Because HeadObject has gzip enabled, head cannot get the file size correctly. If you need to get the file size, please use getObjectMeta' | ||
); | ||
options.subres = Object.assign({}, options.subres); | ||
@@ -12,0 +16,0 @@ if (options.versionId) { |
@@ -14,2 +14,3 @@ "use strict"; | ||
const { getReqUrl } = require('../client/getReqUrl'); | ||
const { isDingTalk } = require('./isDingTalk'); | ||
function getHeader(headers, name) { | ||
@@ -47,2 +48,5 @@ return headers[name] || headers[name.toLowerCase()]; | ||
} | ||
else if (isDingTalk()) { | ||
headers['Content-Type'] = 'application/octet-stream'; | ||
} | ||
else { | ||
@@ -49,0 +53,0 @@ headers['Content-Type'] = mime.getType(params.mime || path.extname(params.object || '')); |
@@ -11,2 +11,3 @@ const crypto = require('crypto'); | ||
const { getReqUrl } = require('../client/getReqUrl'); | ||
const { isDingTalk } = require('./isDingTalk'); | ||
@@ -62,2 +63,4 @@ interface Headers { | ||
headers['Content-Type'] = params.mime; | ||
} else if (isDingTalk()) { | ||
headers['Content-Type'] = 'application/octet-stream'; | ||
} else { | ||
@@ -64,0 +67,0 @@ headers['Content-Type'] = mime.getType(params.mime || path.extname(params.object || '')); |
@@ -269,17 +269,22 @@ const debug = require('debug')('ali-oss:object'); | ||
} | ||
objects = objects.map(obj => ({ | ||
name: obj.Key, | ||
url: that._objectUrl(obj.Key), | ||
lastModified: obj.LastModified, | ||
etag: obj.ETag, | ||
type: obj.Type, | ||
size: Number(obj.Size), | ||
storageClass: obj.StorageClass, | ||
owner: obj.Owner | ||
? { | ||
id: obj.Owner.ID, | ||
displayName: obj.Owner.DisplayName | ||
} | ||
: null | ||
})); | ||
objects = objects.map(obj => { | ||
let owner = null; | ||
if (obj.Owner) { | ||
owner = { | ||
id: obj.Owner.ID, | ||
displayName: obj.Owner.DisplayName | ||
}; | ||
} | ||
return { | ||
name: obj.Key, | ||
url: that._objectUrl(obj.Key), | ||
lastModified: obj.LastModified, | ||
etag: obj.ETag, | ||
type: obj.Type, | ||
size: Number(obj.Size), | ||
storageClass: obj.StorageClass, | ||
owner | ||
}; | ||
}); | ||
} | ||
@@ -286,0 +291,0 @@ let prefixes = result.data.CommonPrefixes || null; |
{ | ||
"name": "ali-oss", | ||
"version": "6.18.0", | ||
"version": "6.18.1", | ||
"description": "aliyun oss(object storage service) node client", | ||
@@ -33,3 +33,2 @@ "main": "./lib/client.js", | ||
"snyk-protect": "snyk-protect", | ||
"prepublish": "npm run snyk-protect", | ||
"lint-staged": "lint-staged", | ||
@@ -50,5 +49,13 @@ "detect-secrets": "node task/detect-secrets", | ||
}, | ||
"homepage": "https://github.com/ali-sdk/ali-oss", | ||
"bugs": { | ||
"url": "https://github.com/ali-sdk/ali-oss/issues" | ||
}, | ||
"publishConfig": { | ||
"registry": "https://registry.npmjs.org/", | ||
"access": "public" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/aliyun/oss-nodejs-sdk.git" | ||
"url": "https://github.com/ali-sdk/ali-oss.git" | ||
}, | ||
@@ -63,9 +70,5 @@ "keywords": [ | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/aliyun/oss-nodejs-sdk/issues" | ||
}, | ||
"engines": { | ||
"node": ">=8" | ||
}, | ||
"homepage": "https://github.com/aliyun/oss-nodejs-sdk", | ||
"devDependencies": { | ||
@@ -77,4 +80,8 @@ "@babel/core": "^7.11.6", | ||
"@babel/runtime": "^7.11.2", | ||
"@commitlint/cli": "^16.2.4", | ||
"@commitlint/cli": "^17.6.7", | ||
"@commitlint/config-conventional": "^16.2.4", | ||
"@octokit/core": "^5.0.0", | ||
"@semantic-release/exec": "^6.0.3", | ||
"@semantic-release/git": "^10.0.1", | ||
"@semantic-release/npm": "^10.0.5", | ||
"@snyk/protect": "^1.1196.0", | ||
@@ -85,2 +92,3 @@ "@types/node": "^14.0.12", | ||
"aliasify": "^2.0.0", | ||
"axios": "0.27.2", | ||
"babelify": "^10.0.0", | ||
@@ -90,3 +98,3 @@ "beautify-benchmark": "^0.2.4", | ||
"bluebird": "^3.1.5", | ||
"browserify": "13.3.0", | ||
"browserify": "^17.0.0", | ||
"core-js": "^3.6.5", | ||
@@ -103,7 +111,8 @@ "crypto-js": "^3.1.9-1", | ||
"filereader": "^0.10.3", | ||
"form-data": "^4.0.0", | ||
"git-pre-hooks": "^1.2.0", | ||
"husky": "^8.0.3", | ||
"husky": "^7.0.4", | ||
"immediate": "^3.3.0", | ||
"karma": "^6.3.4", | ||
"karma-browserify": "^5.1.1", | ||
"karma-browserify": "^8.1.0", | ||
"karma-chrome-launcher": "^2.2.0", | ||
@@ -120,6 +129,6 @@ "karma-firefox-launcher": "^1.0.1", | ||
"promise-polyfill": "^6.0.2", | ||
"puppeteer": "^20.9.0", | ||
"request": "^2.88.0", | ||
"puppeteer": "19.0.0", | ||
"semantic-release": "^21.1.1", | ||
"should": "^11.0.0", | ||
"sinon": "^1.17.7", | ||
"sinon": "^15.2.0", | ||
"standard-version": "^9.3.1", | ||
@@ -130,3 +139,3 @@ "stream-equal": "^1.1.0", | ||
"uglify-js": "^3.14.2", | ||
"watchify": "^3.11.1" | ||
"watchify": "^4.0.0" | ||
}, | ||
@@ -139,3 +148,3 @@ "dependencies": { | ||
"dateformat": "^2.0.0", | ||
"debug": "^2.2.0", | ||
"debug": "^4.3.4", | ||
"destroy": "^1.0.4", | ||
@@ -155,5 +164,5 @@ "end-or-error": "^1.0.1", | ||
"stream-wormhole": "^1.0.4", | ||
"urllib": "^2.33.1", | ||
"urllib": "2.41.0", | ||
"utility": "^1.18.0", | ||
"xml2js": "^0.4.16" | ||
"xml2js": "^0.6.2" | ||
}, | ||
@@ -160,0 +169,0 @@ "snyk": true, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 2 instances in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
225
4640
2519174
60
49227
1
7
7
+ Addeddebug@4.4.0(transitive)
+ Addediconv-lite@0.4.24(transitive)
+ Addedip@1.1.9(transitive)
+ Addedms@2.1.3(transitive)
+ Addedurllib@2.41.0(transitive)
+ Addedxml2js@0.6.2(transitive)
- Removediconv-lite@0.6.3(transitive)
- Removedurllib@2.44.0(transitive)
- Removedxml2js@0.4.23(transitive)
Updateddebug@^4.3.4
Updatedurllib@2.41.0
Updatedxml2js@^0.6.2