From 3b5afbe59ff8fdc6d4cdc668e42607c98ca81e13 Mon Sep 17 00:00:00 2001 From: king729 <87287864@qq.com> Date: Wed, 10 Jan 2018 16:11:36 +0800 Subject: [PATCH 1/2] utf-8 string length for invoke --- policies/invoke/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/policies/invoke/index.js b/policies/invoke/index.js index b5b1a95..d330152 100644 --- a/policies/invoke/index.js +++ b/policies/invoke/index.js @@ -166,6 +166,8 @@ function _main(props, context, next, logger, writeDst, tlsProfile) { data = String(data); } } + if(typeof data === 'string') + data = new Buffer(data,"utf8"); dataSz = data.length; // chunked-upload From a10feb3a40c0ddce5adaabcf81265e41e6bedcb8 Mon Sep 17 00:00:00 2001 From: king729 <87287864@qq.com> Date: Thu, 11 Jan 2018 15:58:45 +0800 Subject: [PATCH 2/2] utf-8 string length for invoke --- policies/invoke/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/policies/invoke/index.js b/policies/invoke/index.js index d330152..66dcdf5 100644 --- a/policies/invoke/index.js +++ b/policies/invoke/index.js @@ -166,8 +166,9 @@ function _main(props, context, next, logger, writeDst, tlsProfile) { data = String(data); } } - if(typeof data === 'string') - data = new Buffer(data,"utf8"); + if (typeof data === 'string') { + data = new Buffer(data, 'utf8'); + } dataSz = data.length; // chunked-upload