mirror of https://github.com/zulip/zulip.git
Disable unsupported SockJS transports
Because our authentication system reads cookies from the initial connection attempt, several SockJS transports can't be used. (imported from commit 34b9571225d39072985b8223fb12c43c7235841f)
This commit is contained in:
parent
ca16644152
commit
3c73468ba8
|
@ -12,7 +12,9 @@ function Socket(url) {
|
|||
this._is_unloading = true;
|
||||
});
|
||||
|
||||
this._sockjs = new SockJS(url);
|
||||
this._supported_protocols = ['websocket', 'xdr-streaming', 'xhr-streaming',
|
||||
'xdr-polling', 'xhr-polling', 'jsonp-polling'];
|
||||
this._sockjs = new SockJS(url, null, {protocols_whitelist: this._supported_protocols});
|
||||
this._setup_sockjs_callbacks(this._sockjs);
|
||||
}
|
||||
|
||||
|
@ -119,7 +121,7 @@ Socket.prototype = {
|
|||
|
||||
setTimeout(function () {
|
||||
blueslip.info("Attempting reconnect.");
|
||||
that._sockjs = new SockJS(that.url);
|
||||
that._sockjs = new SockJS(that.url, null, {protocols_whitelist: that._supported_protocols});
|
||||
that._setup_sockjs_callbacks(that._sockjs);
|
||||
}, wait_time);
|
||||
}
|
||||
|
|
|
@ -147,6 +147,7 @@ def respond_send_message(chan, method, props, data):
|
|||
200, 'send_message', connection.session.user_profile.email)
|
||||
|
||||
sockjs_router = sockjs.tornado.SockJSRouter(SocketConnection, "/sockjs",
|
||||
{'sockjs_url': 'https://%s/static/third/sockjs/sockjs-0.3.4.js' % (settings.EXTERNAL_HOST,)})
|
||||
{'sockjs_url': 'https://%s/static/third/sockjs/sockjs-0.3.4.js' % (settings.EXTERNAL_HOST,),
|
||||
'disabled_transports': ['eventsource', 'htmlfile']})
|
||||
def get_sockjs_router():
|
||||
return sockjs_router
|
||||
|
|
Loading…
Reference in New Issue