diff --git a/engine.io.js b/engine.io.js index 5c4f54a8cadea17685d367d0117cbbeaded3027c..a37bbd6f997d6ad24f1e0fa2b33b4587e1fc1d54 100644 --- a/engine.io.js +++ b/engine.io.js @@ -1164,10 +1164,6 @@ return /******/ (function(modules) { // webpackBootstrap xhr.setRequestHeader('Accept', '*/*'); } catch (e) {} - if (this.supportsBinary) { - xhr.responseType = 'arraybuffer'; - } - // ie6 check if ('withCredentials' in xhr) { xhr.withCredentials = true; @@ -1189,8 +1185,8 @@ return /******/ (function(modules) { // webpackBootstrap if (xhr.readyState === 2) { try { var contentType = xhr.getResponseHeader('Content-Type'); - if (contentType !== 'application/octet-stream') { - xhr.responseType = 'text'; + if (self.supportsBinary && contentType === 'application/octet-stream') { + xhr.responseType = 'arraybuffer'; } } catch (e) {} } @@ -1303,8 +1299,6 @@ return /******/ (function(modules) { // webpackBootstrap } catch (e) {} if (contentType === 'application/octet-stream') { data = this.xhr.response || this.xhr.responseText; - } else if (this.xhr.responseType === 'arraybuffer') { - data = String.fromCharCode.apply(null, new Uint8Array(this.xhr.response)); } else { data = this.xhr.responseText; } diff --git a/package.json b/package.json index 010403d582b6977235905bfc1590c7d37a4d05a8..0fe4d6a03c107375c5c165dd23c230c76b8b099d 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "engine.io-client", "description": "Client for the realtime Engine", "license": "MIT", - "version": "3.2.0", + "version": "3.2.1", "main": "lib/index.js", "homepage": "https://github.com/socketio/engine.io-client", "contributors": [