From b5df6faadfb9c518be5161f76368d4c8a445f60e Mon Sep 17 00:00:00 2001 From: lanvent Date: Sat, 22 Apr 2023 01:30:21 +0800 Subject: [PATCH] feat: verify server when receive message in wechatmp --- channel/wechatmp/active_reply.py | 1 + channel/wechatmp/passive_reply.py | 1 + 2 files changed, 2 insertions(+) diff --git a/channel/wechatmp/active_reply.py b/channel/wechatmp/active_reply.py index 105ca233e..c288ef680 100644 --- a/channel/wechatmp/active_reply.py +++ b/channel/wechatmp/active_reply.py @@ -21,6 +21,7 @@ def POST(self): # Make sure to return the instance that first created, @singleton will do that. channel = WechatMPChannel() try: + verify_server(web.input()) message = web.data() # todo crypto # logger.debug("[wechatmp] Receive request:\n" + webData.decode("utf-8")) msg = parse_message(message) diff --git a/channel/wechatmp/passive_reply.py b/channel/wechatmp/passive_reply.py index 3407198cc..3280472ac 100644 --- a/channel/wechatmp/passive_reply.py +++ b/channel/wechatmp/passive_reply.py @@ -20,6 +20,7 @@ def GET(self): def POST(self): try: + verify_server(web.input()) request_time = time.time() channel = WechatMPChannel() message = web.data() # todo crypto