Missed SSL flag

This commit is contained in:
Fabio Manganiello 2018-11-02 00:02:11 +01:00
parent 3eed774d50
commit a77a9c04b7
2 changed files with 3 additions and 2 deletions

View File

@ -271,7 +271,8 @@ class HttpBackend(Backend):
enabled_plugins[plugin] = conf
return render_template('index.html', plugins=enabled_plugins, hidden_plugins=hidden_plugins,
token=Config.get('token'), websocket_port=self.websocket_port)
token=Config.get('token'), websocket_port=self.websocket_port,
has_ssl=self.ssl_cert is not None)
@app.route('/widget/<widget>', methods=['POST'])

View File

@ -9,7 +9,7 @@ $(document).ready(function() {
var initWebsocket = function() {
try {
url_prefix = window.ssl_cert ? 'wss://' : 'ws://';
url_prefix = window.has_ssl ? 'wss://' : 'ws://';
websocket = new WebSocket(url_prefix + window.location.hostname + ':' + window.websocket_port);
} catch (err) {
websocket = undefined;