Pārlūkot izejas kodu

HUE-8738 [task] Use https for websocket accordingly

Romain 5 gadi atpakaļ
vecāks
revīzija
3dbf982a8f

+ 2 - 1
desktop/libs/notebook/src/notebook/templates/editor_components2.mako

@@ -1578,7 +1578,8 @@
     });
 
     % if conf.WEBSOCKETS.ENABLED.get():
-      var editorWs = new WebSocket('ws://' + window.location.host + '/ws/editor/results/' + 'userA' + '/');
+      const prefix = location.protocol === 'https:' ? 'wss://' : 'ws://';
+      var editorWs = new WebSocket(prefix + window.location.host + '/ws/editor/results/' + 'userA' + '/');
 
       editorWs.onopen = function(e) {
         console.info('Notification socket open.');