From 1982f7782865e4b438b611c92298d913b2a0efd6 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 2 Mar 2026 10:09:19 +0800 Subject: [PATCH] bugfix --- woa/init.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/woa/init.py b/woa/init.py index 958d332..31f6a5a 100644 --- a/woa/init.py +++ b/woa/init.py @@ -158,17 +158,11 @@ class WOAHandler: timestamp = request.query.get('timestamp', '') nonce = request.query.get('nonce', '') echo_str = request.query.get('echostr', '') - + debug(f'{request.query=}') # 1. 验证签名 try: - if echo_str: - # GET 请求:验证 URL - echo_str = self.crypto._check_signature(signature, timestamp, nonce, echo_str) - return True, echo_str - else: - # POST 请求:验证签名 (不返回 echo_str,只返回 True) - self.crypto._check_signature(signature, timestamp, nonce, '') - return True, None + echo_str = self.crypto._check_signature(signature, timestamp, nonce, echo_str) + return True, echo_str except InvalidSignatureException: logger.warning("签名验证失败") return False, None