OSDN Git Service

authoryamat0jp <yamat0jp@yahoo.co.jp>
Fri, 7 Sep 2018 11:33:59 +0000 (20:33 +0900)
committeryamat0jp <yamat0jp@yahoo.co.jp>
Fri, 7 Sep 2018 11:33:59 +0000 (20:33 +0900)
bot.py

diff --git a/bot.py b/bot.py
index 5b408b7..0d5aeff 100644 (file)
--- a/bot.py
+++ b/bot.py
@@ -55,8 +55,8 @@ class WebHookHandler(tornado.web.RequestHandler):
         return ans
             
     def post(self):
-        header = self.request.headers
-        body = self.request.body.decode('utf-8')
+        header = self.request.headers.get('X-Line-Signature')
+        body = tornado.escape.json_decode(self.request.body)
         '''
         hashid = hmac.new(header.get('X-Line-Signature'),
             body.decode('utf-8'), hashlib.sha256).digest()