提交 84a0ddec 编写于 作者: K Konstantin Baumann

http adapter: return a `Buffer` instead of a `String` in case of `responseType === 'arraybuffer'`

上级 84027a31
...@@ -65,9 +65,13 @@ module.exports = function httpAdapter(resolve, reject, config) { ...@@ -65,9 +65,13 @@ module.exports = function httpAdapter(resolve, reject, config) {
}); });
res.on('end', function () { res.on('end', function () {
var data = Buffer.concat(responseBuffer);
if (config.responseType !== 'arraybuffer') {
data = data.toString('utf8');
}
var response = { var response = {
data: transformData( data: transformData(
Buffer.concat(responseBuffer).toString('utf8'), data,
res.headers, res.headers,
config.transformResponse config.transformResponse
), ),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册