Skip to content

Commit 0071fdf

Browse files
[chore] Release 3.1.5
1 parent 64ce480 commit 0071fdf

File tree

2 files changed

+61
-21
lines changed

2 files changed

+61
-21
lines changed

engine.io.js

+59-19
Original file line numberDiff line numberDiff line change
@@ -1164,6 +1164,10 @@ return /******/ (function(modules) { // webpackBootstrap
11641164
xhr.setRequestHeader('Accept', '*/*');
11651165
} catch (e) {}
11661166

1167+
if (this.supportsBinary) {
1168+
xhr.responseType = 'arraybuffer';
1169+
}
1170+
11671171
// ie6 check
11681172
if ('withCredentials' in xhr) {
11691173
xhr.withCredentials = true;
@@ -1183,13 +1187,12 @@ return /******/ (function(modules) { // webpackBootstrap
11831187
} else {
11841188
xhr.onreadystatechange = function () {
11851189
if (xhr.readyState === 2) {
1186-
var contentType;
11871190
try {
1188-
contentType = xhr.getResponseHeader('Content-Type');
1191+
var contentType = xhr.getResponseHeader('Content-Type');
1192+
if (contentType !== 'application/octet-stream') {
1193+
xhr.responseType = 'text';
1194+
}
11891195
} catch (e) {}
1190-
if (contentType === 'application/octet-stream') {
1191-
xhr.responseType = 'arraybuffer';
1192-
}
11931196
}
11941197
if (4 !== xhr.readyState) return;
11951198
if (200 === xhr.status || 1223 === xhr.status) {
@@ -1299,7 +1302,11 @@ return /******/ (function(modules) { // webpackBootstrap
12991302
contentType = this.xhr.getResponseHeader('Content-Type');
13001303
} catch (e) {}
13011304
if (contentType === 'application/octet-stream') {
1302-
data = this.xhr.response || this.xhr.responseText;
1305+
if (this.xhr.responseType === 'arraybuffer') {
1306+
data = this.xhr.response || this.xhr.responseText;
1307+
} else {
1308+
data = String.fromCharCode.apply(null, new Uint8Array(this.xhr.response));
1309+
}
13031310
} else {
13041311
data = this.xhr.responseText;
13051312
}
@@ -3335,12 +3342,17 @@ return /******/ (function(modules) { // webpackBootstrap
33353342
*/
33363343

33373344
exports.colors = [
3338-
'lightseagreen',
3339-
'forestgreen',
3340-
'goldenrod',
3341-
'dodgerblue',
3342-
'darkorchid',
3343-
'crimson'
3345+
'#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC',
3346+
'#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF',
3347+
'#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC',
3348+
'#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF',
3349+
'#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC',
3350+
'#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033',
3351+
'#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366',
3352+
'#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933',
3353+
'#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC',
3354+
'#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF',
3355+
'#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'
33443356
];
33453357

33463358
/**
@@ -3359,6 +3371,11 @@ return /******/ (function(modules) { // webpackBootstrap
33593371
return true;
33603372
}
33613373

3374+
// Internet Explorer and Edge do not support colors.
3375+
if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
3376+
return false;
3377+
}
3378+
33623379
// is webkit? http://stackoverflow.com/a/16459606/376773
33633380
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
33643381
return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
@@ -3710,6 +3727,11 @@ return /******/ (function(modules) { // webpackBootstrap
37103727
exports.enabled = enabled;
37113728
exports.humanize = __webpack_require__(25);
37123729

3730+
/**
3731+
* Active `debug` instances.
3732+
*/
3733+
exports.instances = [];
3734+
37133735
/**
37143736
* The currently active debug mode names, and names to skip.
37153737
*/
@@ -3725,12 +3747,6 @@ return /******/ (function(modules) { // webpackBootstrap
37253747

37263748
exports.formatters = {};
37273749

3728-
/**
3729-
* Previous log timestamp.
3730-
*/
3731-
3732-
var prevTime;
3733-
37343750
/**
37353751
* Select a color.
37363752
* @param {String} namespace
@@ -3759,6 +3775,8 @@ return /******/ (function(modules) { // webpackBootstrap
37593775

37603776
function createDebug(namespace) {
37613777

3778+
var prevTime;
3779+
37623780
function debug() {
37633781
// disabled?
37643782
if (!debug.enabled) return;
@@ -3815,15 +3833,28 @@ return /******/ (function(modules) { // webpackBootstrap
38153833
debug.enabled = exports.enabled(namespace);
38163834
debug.useColors = exports.useColors();
38173835
debug.color = selectColor(namespace);
3836+
debug.destroy = destroy;
38183837

38193838
// env-specific initialization logic for debug instances
38203839
if ('function' === typeof exports.init) {
38213840
exports.init(debug);
38223841
}
38233842

3843+
exports.instances.push(debug);
3844+
38243845
return debug;
38253846
}
38263847

3848+
function destroy () {
3849+
var index = exports.instances.indexOf(this);
3850+
if (index !== -1) {
3851+
exports.instances.splice(index, 1);
3852+
return true;
3853+
} else {
3854+
return false;
3855+
}
3856+
}
3857+
38273858
/**
38283859
* Enables a debug mode by namespaces. This can include modes
38293860
* separated by a colon and wildcards.
@@ -3838,10 +3869,11 @@ return /******/ (function(modules) { // webpackBootstrap
38383869
exports.names = [];
38393870
exports.skips = [];
38403871

3872+
var i;
38413873
var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
38423874
var len = split.length;
38433875

3844-
for (var i = 0; i < len; i++) {
3876+
for (i = 0; i < len; i++) {
38453877
if (!split[i]) continue; // ignore empty strings
38463878
namespaces = split[i].replace(/\*/g, '.*?');
38473879
if (namespaces[0] === '-') {
@@ -3850,6 +3882,11 @@ return /******/ (function(modules) { // webpackBootstrap
38503882
exports.names.push(new RegExp('^' + namespaces + '$'));
38513883
}
38523884
}
3885+
3886+
for (i = 0; i < exports.instances.length; i++) {
3887+
var instance = exports.instances[i];
3888+
instance.enabled = exports.enabled(instance.namespace);
3889+
}
38533890
}
38543891

38553892
/**
@@ -3871,6 +3908,9 @@ return /******/ (function(modules) { // webpackBootstrap
38713908
*/
38723909

38733910
function enabled(name) {
3911+
if (name[name.length - 1] === '*') {
3912+
return true;
3913+
}
38743914
var i, len;
38753915
for (i = 0, len = exports.skips.length; i < len; i++) {
38763916
if (exports.skips[i].test(name)) {

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "engine.io-client",
33
"description": "Client for the realtime Engine",
44
"license": "MIT",
5-
"version": "3.1.4",
5+
"version": "3.1.5",
66
"main": "lib/index.js",
77
"homepage": "https://github.com/socketio/engine.io-client",
88
"contributors": [
@@ -45,7 +45,7 @@
4545
"concat-stream": "^1.6.0",
4646
"del": "^2.2.2",
4747
"derequire": "^2.0.6",
48-
"engine.io": "3.1.4",
48+
"engine.io": "3.1.5",
4949
"eslint-config-standard": "4.4.0",
5050
"eslint-plugin-standard": "1.3.1",
5151
"expect.js": "^0.3.1",

0 commit comments

Comments
 (0)