diff --git a/lib/socket.io/transports/xhr-polling.js b/lib/socket.io/transports/xhr-polling.js index ed8f2665..c4fa37f9 100644 --- a/lib/socket.io/transports/xhr-polling.js +++ b/lib/socket.io/transports/xhr-polling.js @@ -69,7 +69,7 @@ Polling.prototype._write = function(message){ var headers = {'Content-Type': 'text/plain; charset=UTF-8', 'Content-Length': Buffer.byteLength(message)}; // https://developer.mozilla.org/En/HTTP_Access_Control if (this.request.headers.origin && this._verifyOrigin(this.request.headers.origin)){ - headers['Access-Control-Allow-Origin'] = this.request.headers.origin; + headers['Access-Control-Allow-Origin'] = (this.request.headers.origin === 'null' ? '*' : this.request.headers.origin); if (this.request.headers.cookie) headers['Access-Control-Allow-Credentials'] = 'true'; } this.response.writeHead(200, headers);