mirror of
https://github.com/tenrok/axios.git
synced 2026-06-02 16:04:10 +03:00
http adapter: return a Buffer instead of a String in case of 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