summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/core/web
diff options
context:
space:
mode:
authorKali Kaneko (leap communications) <kali@leap.se>2016-12-15 11:44:53 +0100
committerKali Kaneko (leap communications) <kali@leap.se>2016-12-29 03:10:01 +0100
commitd215cedd5efdbedbaaf9e62626b9178b364d55f7 (patch)
tree141718bbabd3de952d524df20db52cbfa53b6e7c /src/leap/bitmask/core/web
parent5481d60a470cd70be5a96b4e674987f41b4481b7 (diff)
[bug] avoid unicode conversion bug
encode to ascii any parameter passed as unicode.
Diffstat (limited to 'src/leap/bitmask/core/web')
-rw-r--r--src/leap/bitmask/core/web/api.py2
1 files changed, 2 insertions, 0 deletions
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)