From d215cedd5efdbedbaaf9e62626b9178b364d55f7 Mon Sep 17 00:00:00 2001 From: "Kali Kaneko (leap communications)" Date: Thu, 15 Dec 2016 11:44:53 +0100 Subject: [bug] avoid unicode conversion bug encode to ascii any parameter passed as unicode. --- src/leap/bitmask/core/web/api.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/leap/bitmask/core/web/api.py b/src/leap/bitmask/core/web/api.py index 6c386b5d..d31afa50 100644 --- a/src/leap/bitmask/core/web/api.py +++ b/src/leap/bitmask/core/web/api.py @@ -25,6 +25,8 @@ class Api(Resource): # expects strings. This 'str(param)' conversion can be removed # if we move to python3 for param in json.loads(params): + if isinstance(param, basestring): + param = param.encode('ascii', 'replace') command.append(str(param)) d = self.dispatcher.dispatch(command) -- cgit v1.2.3