Added custom log name

This commit is contained in:
2019-11-22 09:43:37 +00:00
parent c4b856da62
commit 646700c73f
699 changed files with 5186 additions and 4259 deletions

View File

@ -77,6 +77,7 @@ XHR.prototype.request = function (opts) {
opts.agent = this.agent || false;
opts.supportsBinary = this.supportsBinary;
opts.enablesXDR = this.enablesXDR;
opts.withCredentials = this.withCredentials;
// SSL options for Node.js client
opts.pfx = this.pfx;
@ -150,6 +151,7 @@ function Request (opts) {
this.isBinary = opts.isBinary;
this.supportsBinary = opts.supportsBinary;
this.enablesXDR = opts.enablesXDR;
this.withCredentials = opts.withCredentials;
this.requestTimeout = opts.requestTimeout;
// SSL options for Node.js client
@ -224,7 +226,7 @@ Request.prototype.create = function () {
// ie6 check
if ('withCredentials' in xhr) {
xhr.withCredentials = true;
xhr.withCredentials = this.withCredentials;
}
if (this.requestTimeout) {
@ -243,7 +245,7 @@ Request.prototype.create = function () {
if (xhr.readyState === 2) {
try {
var contentType = xhr.getResponseHeader('Content-Type');
if (self.supportsBinary && contentType === 'application/octet-stream') {
if (self.supportsBinary && contentType === 'application/octet-stream' || contentType === 'application/octet-stream; charset=UTF-8') {
xhr.responseType = 'arraybuffer';
}
} catch (e) {}
@ -255,7 +257,7 @@ Request.prototype.create = function () {
// make sure the `error` event handler that's user-set
// does not throw in the same tick and gets caught here
setTimeout(function () {
self.onError(xhr.status);
self.onError(typeof xhr.status === 'number' ? xhr.status : 0);
}, 0);
}
};
@ -355,7 +357,7 @@ Request.prototype.onLoad = function () {
try {
contentType = this.xhr.getResponseHeader('Content-Type');
} catch (e) {}
if (contentType === 'application/octet-stream') {
if (contentType === 'application/octet-stream' || contentType === 'application/octet-stream; charset=UTF-8') {
data = this.xhr.response || this.xhr.responseText;
} else {
data = this.xhr.responseText;

View File

@ -15,7 +15,9 @@ if (typeof WebSocket !== 'undefined') {
BrowserWebSocket = WebSocket;
} else if (typeof self !== 'undefined') {
BrowserWebSocket = self.WebSocket || self.MozWebSocket;
} else {
}
if (typeof window === 'undefined') {
try {
NodeWebSocket = require('ws');
} catch (e) { }