mirror of
https://github.com/silkimen/cordova-plugin-advanced-http.git
synced 2026-04-24 00:00:03 +08:00
Fix #224: responseType "arraybuffer" and "blob" not working on browser platform
This commit is contained in:
@@ -236,6 +236,13 @@ module.exports = function init(jsUtil, cookieHandler, messages, base64) {
|
||||
|
||||
function injectRawResponseHandler(responseType, cb) {
|
||||
return function (response) {
|
||||
var dataType = jsUtil.getTypeOf(response.data);
|
||||
|
||||
// don't need post-processing if it's already binary type (on browser platform)
|
||||
if (dataType === 'ArrayBuffer' || dataType === 'Blob') {
|
||||
return cb(response);
|
||||
}
|
||||
|
||||
// arraybuffer
|
||||
if (responseType === validResponseTypes[1]) {
|
||||
var buffer = base64.toArrayBuffer(response.data);
|
||||
|
||||
Reference in New Issue
Block a user