diff --git a/jellyfin_kodi/jellyfin/websocket.py b/jellyfin_kodi/jellyfin/websocket.py index b0d91f34..47bbf05c 100644 --- a/jellyfin_kodi/jellyfin/websocket.py +++ b/jellyfin_kodi/jellyfin/websocket.py @@ -545,7 +545,9 @@ class WebSocket(object): return False result = result.lower() - value = key + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11".encode() + # https://tools.ietf.org/html/rfc6455#page-6 + magic_string = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11".encode() + value = key + magic_string hashed = base64.encodestring(hashlib.sha1(value).digest()).strip().lower().decode() return hashed == result