From 2ef89daf4c43dae56377b7a6e6c54a8e09dfbc96 Mon Sep 17 00:00:00 2001 From: Giuseppe Guerra Date: Tue, 31 Oct 2017 13:11:01 +0100 Subject: [PATCH] Force ASCII encoding in /api/v1/fokabotMessage --- handlers/apiFokabotMessageHandler.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/handlers/apiFokabotMessageHandler.py b/handlers/apiFokabotMessageHandler.py index 9a5ac95..85e2729 100644 --- a/handlers/apiFokabotMessageHandler.py +++ b/handlers/apiFokabotMessageHandler.py @@ -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