mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 17:07:07 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user