mirror of
https://github.com/tenrok/axios.git
synced 2026-05-30 15:24:11 +03:00
Merge pull request #128 from Kosta-Github/allow_arraybuffer_response
fixing http adapter WRT `responseType === 'arraybuffer'`
This commit is contained in:
@@ -65,9 +65,13 @@ module.exports = function httpAdapter(resolve, reject, config) {
|
||||
});
|
||||
|
||||
res.on('end', function () {
|
||||
var data = Buffer.concat(responseBuffer);
|
||||
if (config.responseType !== 'arraybuffer') {
|
||||
data = data.toString('utf8');
|
||||
}
|
||||
var response = {
|
||||
data: transformData(
|
||||
Buffer.concat(responseBuffer).toString('utf8'),
|
||||
data,
|
||||
res.headers,
|
||||
config.transformResponse
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user