hc-service-client
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -32,5 +32,8 @@ 'use strict'; | ||
this.signatureApproach = options.signatureApproach || 'systemCall'; // 签名方法名 | ||
this.signatureProcessor = this.signatureApproach === 'userAuth' ? require('./signature/user_auth') : require('./signature/system_call'); // 签名处理方法 | ||
if (this.signatureApproach === 'common-user') { | ||
this.signatureProcessor = require('./signature/common_user_auth'); | ||
} else if (this.signatureApproach === 'userAuth') { | ||
this.signatureProcessor = require('./signature/user_auth'); | ||
} else { | ||
this.signatureProcessor = require('./signature/system_call'); | ||
} | ||
@@ -37,0 +40,0 @@ this.timeout = options.timeout || 60000; // 请求超时,默认60秒 |
@@ -25,7 +25,7 @@ 'use strict'; | ||
let bodymd5; | ||
if (!body) { | ||
bodymd5 = body; | ||
} else { | ||
if (['POST', 'PUT', 'PATCH'].indexOf(method) >= 0) { | ||
bodymd5 = md5(Buffer.from(body)); | ||
headers['Content-MD5'] = bodymd5; | ||
} else { | ||
bodymd5 = ''; | ||
} | ||
@@ -32,0 +32,0 @@ let stringToSign = method + '\n' + accept + '\n' + bodymd5 + |
{ | ||
"name": "hc-service-client", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Service Client Extension for Honeybee", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
48516
1029