Skip to content

Commit bbce2b2

Browse files
Only check if ACL is an array if it's not null
1 parent e3b05c2 commit bbce2b2

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib-es5/auth_token.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ module.exports = function (options) {
6565
}
6666
tokenParts.push(`exp=${options.expiration}`);
6767
if (options.acl != null) {
68+
if (Array.isArray(options.acl) === true) {
69+
options.acl = options.acl.join("!");
70+
}
6871
tokenParts.push(`acl=${escapeToLower(options.acl)}`);
6972
}
70-
if (Array.isArray(options.acl) === true) {
71-
options.acl = options.acl.join("!");
72-
}
7373
var toSign = [].concat(tokenParts);
7474
if (options.url != null && options.acl == null) {
7575
var url = escapeToLower(options.url);

lib/auth_token.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ module.exports = function (options) {
6161
if (options.start_time != null) {
6262
tokenParts.push(`st=${options.start_time}`);
6363
}
64-
if (Array.isArray(options.acl) === true) {
65-
options.acl = options.acl.join("!");
66-
}
6764
tokenParts.push(`exp=${options.expiration}`);
6865
if (options.acl != null) {
66+
if (Array.isArray(options.acl) === true) {
67+
options.acl = options.acl.join("!");
68+
}
6969
tokenParts.push(`acl=${escapeToLower(options.acl)}`);
7070
}
7171
let toSign = [...tokenParts];

0 commit comments

Comments
 (0)