Skip to content

Commit 2266269

Browse files
SQRederdarrachequesne
authored andcommitted
[feat] Support extra charset info in Content-Type header (#619)
XHR Polling failed to make handshake with server that adds charset info into Content-Type header. Closes #618
1 parent 2847411 commit 2266269

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/transports/polling-xhr.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ Request.prototype.create = function () {
245245
if (xhr.readyState === 2) {
246246
try {
247247
var contentType = xhr.getResponseHeader('Content-Type');
248-
if (self.supportsBinary && contentType === 'application/octet-stream') {
248+
if (self.supportsBinary && contentType === 'application/octet-stream' || contentType === 'application/octet-stream; charset=UTF-8') {
249249
xhr.responseType = 'arraybuffer';
250250
}
251251
} catch (e) {}
@@ -357,7 +357,7 @@ Request.prototype.onLoad = function () {
357357
try {
358358
contentType = this.xhr.getResponseHeader('Content-Type');
359359
} catch (e) {}
360-
if (contentType === 'application/octet-stream') {
360+
if (contentType === 'application/octet-stream' || contentType === 'application/octet-stream; charset=UTF-8') {
361361
data = this.xhr.response || this.xhr.responseText;
362362
} else {
363363
data = this.xhr.responseText;

0 commit comments

Comments
 (0)