Skip to content

Commit 6d48b15

Browse files
committed
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.
1 parent 76897b5 commit 6d48b15

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

websockify/token_plugins.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,5 +155,6 @@ def lookup(self, token):
155155
return None
156156
else:
157157
combo = simplejson.loads(stuff.decode("utf-8"))
158-
pair = combo["host"]
159-
return pair.split(':')
158+
(host, port) = combo["host"].split(':')
159+
port = port.encode('ascii','ignore')
160+
return [ host, port ]

0 commit comments

Comments
 (0)