@ -552,6 +552,10 @@ configureEditors: function () {
|
||||
},
|
||||
|
||||
showWebsocketError: function() {
|
||||
if (window.navigator.userAgent.indexOf('Edge') > -1) {
|
||||
// Mute errors in Microsoft Edge
|
||||
return;
|
||||
}
|
||||
$.flash.danger({
|
||||
text: $('#flash').data('message-failure')
|
||||
});
|
||||
|
@ -4,10 +4,11 @@ CodeOceanEditorWebsocket = {
|
||||
createSocketUrl: function(url) {
|
||||
var sockURL = new URL(window.location);
|
||||
sockURL.pathname = url;
|
||||
sockURL.protocol = '<%= DockerClient.config['ws_client_protocol'] %>';
|
||||
// sanitize socket protocol string, strip trailing slash and other malicious chars if they are there
|
||||
sockURL.protocol = '<%= DockerClient.config['ws_client_protocol']&.match(/(\w+):*\/*/)&.to_a&.at(1) %>:';
|
||||
|
||||
// strip anchor if it is in the url
|
||||
sockURL.hash = ''
|
||||
sockURL.hash = '';
|
||||
|
||||
return sockURL.toString();
|
||||
},
|
||||
|
@ -108,5 +108,5 @@ CommandSocket.prototype.flush = function() {
|
||||
*/
|
||||
CommandSocket.prototype.killWebSocket = function() {
|
||||
this.websocket.flush();
|
||||
this.websocket.close();
|
||||
};
|
||||
this.websocket.close(1000);
|
||||
};
|
||||
|
Reference in New Issue
Block a user