Skip to content

Commit d648fc5

Browse files
committed
Allow x-domain xhr-polling with Origin: null for Chrome/Safari
1 parent 109a59c commit d648fc5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/socket.io/transports/xhr-polling.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Polling.prototype._write = function(message){
6969
var headers = {'Content-Type': 'text/plain; charset=UTF-8', 'Content-Length': Buffer.byteLength(message)};
7070
// https://developer.mozilla.org/En/HTTP_Access_Control
7171
if (this.request.headers.origin && this._verifyOrigin(this.request.headers.origin)){
72-
headers['Access-Control-Allow-Origin'] = this.request.headers.origin;
72+
headers['Access-Control-Allow-Origin'] = (this.request.headers.origin === 'null' ? '*' : this.request.headers.origin);
7373
if (this.request.headers.cookie) headers['Access-Control-Allow-Credentials'] = 'true';
7474
}
7575
this.response.writeHead(200, headers);

0 commit comments

Comments
 (0)