bugfix
This commit is contained in:
parent
f60517135f
commit
1982f77828
12
woa/init.py
12
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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user