From 6d48b1507e7a0306dc60155ec7895be729b58f58 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Thu, 27 Feb 2020 15:55:35 +0100 Subject: [PATCH] Make sure port is a simple string (again) The redis token plugin also needs to make sure the port string isn't unicode for compatibility with Python 2.x. --- websockify/token_plugins.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/websockify/token_plugins.py b/websockify/token_plugins.py index 03800e7..c42403a 100644 --- a/websockify/token_plugins.py +++ b/websockify/token_plugins.py @@ -155,5 +155,6 @@ class TokenRedis(object): return None else: combo = simplejson.loads(stuff.decode("utf-8")) - pair = combo["host"] - return pair.split(':') + (host, port) = combo["host"].split(':') + port = port.encode('ascii','ignore') + return [ host, port ]