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.
This commit is contained in:
Pierre Ossman 2020-02-27 15:55:35 +01:00
parent 76897b5093
commit 6d48b1507e
1 changed files with 3 additions and 2 deletions

View File

@ -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 ]