Skip to content

Commit 61dcf7b

Browse files
author
hyj1991
authored
Merge pull request #24 from aliyun-node/agentid_ip_mode
adapt agentid with ip
2 parents 79d1238 + 6c3bb9d commit 61dcf7b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

uploader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fs.stat(filepath, function (err, stat) {
4444
var nonce = '' + parseInt((Math.random() * 100000000000), 10);
4545
// get signature
4646
var shasum = crypto.createHash('sha1');
47-
shasum.update([os.hostname(), token, nonce, id].join(''));
47+
shasum.update([process.env.agentid || os.hostname(), token, nonce, id].join(''));
4848
var sign = shasum.digest('hex');
4949

5050
var url = 'http://' + server + '/files/' + id + '?nonce=' + nonce + '&sign=' + sign + '&type=' + type;

0 commit comments

Comments
 (0)