Force ASCII encoding in /api/v1/fokabotMessage

This commit is contained in:
Giuseppe Guerra 2017-10-31 13:11:01 +01:00
parent dc90f506bd
commit 2ef89daf4c

View File

@ -27,7 +27,11 @@ class handler(requestsManager.asyncRequestHandler):
if key is None or key != glob.conf.config["server"]["cikey"]:
raise exceptions.invalidArgumentsException()
chatHelper.sendMessage("FokaBot", self.get_argument("to"), self.get_argument("msg"))
chatHelper.sendMessage(
"FokaBot",
self.get_argument("to").encode().decode("ASCII", "ignore"),
self.get_argument("msg").encode().decode("ASCII", "ignore")
)
# Status code and message
statusCode = 200