From de79508efb6ceab34f41139d1969e5095d1fea25 Mon Sep 17 00:00:00 2001 From: Tom Staubitz Date: Wed, 18 Jan 2017 13:45:30 +0100 Subject: [PATCH] repLACED STRING WITH URL --- app/assets/javascripts/editor/execution.js.erb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/editor/execution.js.erb b/app/assets/javascripts/editor/execution.js.erb index 3cc9b262..2f19d69f 100644 --- a/app/assets/javascripts/editor/execution.js.erb +++ b/app/assets/javascripts/editor/execution.js.erb @@ -2,8 +2,11 @@ CodeOceanEditorWebsocket = { websocket: null, createSocketUrl: function(url) { - var rel_url_root = '<%= (defined? config.relative_url_root) && config.relative_url_root != nil && config.relative_url_root != "" ? config.relative_url_root : "" %>'; - return '<%= DockerClient.config['ws_client_protocol'] %>' + window.location.hostname + ':' + rel_url_root + window.location.port + url; + var sockURL = new URL(window.location); + sockURL.path = url; + sockURL.protocol = '<%= DockerClient.config['ws_client_protocol'] %>'; + + return sockURL.toString(); }, initializeSocket: function(url) {