Skip to content

Commit

Permalink
Fix: sign method (#426)
Browse files Browse the repository at this point in the history
* fix(browser): sign sort fix

* feat: node env >=8

* feat: test ci
  • Loading branch information
binghaiwang authored and PeterRao committed Apr 9, 2018
1 parent f5de168 commit f82bf8f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ sudo: false
language: node_js
node_js:
- '8'
- '6'
- '4'
env:
global:
- secure: Ws1h7ZU97/2npejMZp3/Jac0ZYkgXBW5gEilR5WrnkdkEbIhhK6HamrcqLrA6qCPV0Ax9nNbZCRJcQwPsTdOxBekJ3+3zflMWevfa9+CRS1Hh0mMcn+D864CjrRiQRgIQa8ZoFVPLaL/7qyQp1i7gLbPcpMjO6CA7LgV1reaf+U=
Expand Down
4 changes: 3 additions & 1 deletion lib/common/signUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ exports.buildCanonicalizedResource = function buildCanonicalizedResource(resourc
canonicalizedResource += separatorString + parameters.join('&');
} else if (parameters) {
const compareFunc = (entry1, entry2) => {
if (entry1[0] >= entry2[0]) {
if (entry1[0] > entry2[0]) {

This comment has been minimized.

Copy link
@fengmk2

fengmk2 Apr 13, 2018

Member

为何没有对应的单元测试。。。

This comment has been minimized.

Copy link
@binghaiwang

binghaiwang Apr 13, 2018

Author Contributor

这个主要是chrome和safari浏览器中运行行为不一致的修复,之前对safari缺少了配置,目前已加入配置

return 1;
} else if (entry1[0] < entry2[0]) {
return -1;
}
return 0;
};
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"scripts": {
"test": "mocha -t 60000 -r thunk-mocha -r should test/node/*.test.js",
"test-cov": "istanbul cover node_modules/.bin/_mocha -- -R dot -t 60000 -r thunk-mocha -r should test/*.test.js",
"test-cov": "istanbul cover node_modules/.bin/_mocha -- --require babel-register -R dot -t 60000 -r thunk-mocha -r should test/node/*.test.js",
"jshint": "jshint .",
"autod": "autod",
"build-test": "node browser-build.js > test/browser/build/aliyun-oss-sdk.js && node task/browser-test-build.js > test/browser/build/tests.js",
Expand Down Expand Up @@ -50,14 +50,15 @@
"url": "https://github.com/aliyun/oss-nodejs-sdk/issues"
},
"engines": {
"node": ">=6"
"node": ">=8"
},
"homepage": "https://github.com/aliyun/oss-nodejs-sdk",
"devDependencies": {
"aliasify": "^2.0.0",
"autod": "^2.6.1",
"babel-plugin-transform-runtime": "^6.8.0",
"babel-preset-es2015": "^6.24.1",
"babel-register": "^6.26.0",
"babel-runtime": "^6.6.1",
"babelify": "^7.3.0",
"beautify-benchmark": "^0.2.4",
Expand All @@ -79,9 +80,9 @@
"karma-browserify": "^5.1.1",
"karma-chrome-launcher": "^2.2.0",
"karma-firefox-launcher": "^1.0.1",
"karma-safari-launcher": "^1.0.0",
"karma-ie-launcher": "^1.0.0",
"karma-mocha": "^1.3.0",
"karma-safari-launcher": "^1.0.0",
"mm": "^2.0.0",
"mocha": "^3.5.3",
"promise-polyfill": "^6.0.2",
Expand Down
4 changes: 2 additions & 2 deletions test/node/multipart.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ describe('test/multipart.test.js', () => {
});
const after1 = result.uploads.map(up => up.uploadId);
after1.sort();
const should = barIds.slice(1).concat(fooIds).sort();
assert.deepEqual(after1, should);
const sort1 = barIds.slice(1).concat(fooIds).sort();
assert.deepEqual(after1, sort1);

// after 5
result = yield this.store.listUploads({
Expand Down

0 comments on commit f82bf8f

Please sign in to comment.