Update execution.js.erb

This commit is contained in:
rteusner
2018-05-16 14:41:15 +02:00
committed by GitHub
parent e4525bca36
commit cb56a21951

View File

@ -4,6 +4,7 @@ CodeOceanEditorWebsocket = {
createSocketUrl: function(url) {
var sockURL = new URL(window.location);
sockURL.pathname = url;
// 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