Update web_app.py

This commit is contained in:
Mihail Shevernev 2025-07-15 23:51:53 +03:00 committed by GitHub
parent 7a517f1eba
commit 4eb9483e89
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -134,7 +134,7 @@ def check_webapp_signature(token: str, init_data: str) -> bool:
calculated_hash = hmac.new(
key=secret_key.digest(), msg=data_check_string.encode(), digestmod=hashlib.sha256
).hexdigest()
return calculated_hash == hash_
return hmac.compare_digest(calculated_hash, hash_)
def parse_webapp_init_data(