From 7452c743ba4493f42cb80549710aaf9119e1606d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josip=20Jan=C5=BEi=C4=87?= Date: Mon, 27 Mar 2017 15:16:24 +0200 Subject: [PATCH] Correct check for HTTPS protocol --- src/js/services/pusher/middleware.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/services/pusher/middleware.js b/src/js/services/pusher/middleware.js index 680cd398..a093332f 100755 --- a/src/js/services/pusher/middleware.js +++ b/src/js/services/pusher/middleware.js @@ -78,7 +78,7 @@ const PusherMiddleware = (function(){ connection.username = connection.username.replace(/\W/g, '') socket = new WebSocket( - 'ws'+(state.mopidy.port === '443' ? 's' : '')+'://'+state.mopidy.host+':'+state.mopidy.port+'/iris/ws', + 'ws'+(window.location.protocol === 'https:' ? 's' : '')+'://'+state.mopidy.host+':'+state.mopidy.port+'/iris/ws', [ connection.clientid, connection.connection_id, connection.username ] );