From 21f4a7f544d50b371327754d706955b1373ee73a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Na=CC=88rhinen?= Date: Sun, 25 Jan 2015 14:00:22 +0200 Subject: [PATCH] Add support for arraybuffer requests in browser --- lib/adapters/xhr.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/adapters/xhr.js b/lib/adapters/xhr.js index 2ad7e3e..0d3abb8 100644 --- a/lib/adapters/xhr.js +++ b/lib/adapters/xhr.js @@ -36,7 +36,7 @@ module.exports = function xhrAdapter(resolve, reject, config) { var headers = parseHeaders(request.getAllResponseHeaders()); var response = { data: transformData( - request.responseText, + ['text', ''].indexOf(config.responseType || '') !== -1 ? request.responseText : request.response, headers, config.transformResponse ), @@ -97,4 +97,4 @@ module.exports = function xhrAdapter(resolve, reject, config) { // Send the request request.send(data); -}; \ No newline at end of file +};