This commit is contained in:
yumoqing 2026-03-02 10:09:19 +08:00
parent f60517135f
commit 1982f77828

View File

@ -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