tests: fix mypy type errors in security tests

This commit is contained in:
Username
2026-01-18 10:18:09 +01:00
parent 97bf955820
commit 3be2fd6cf6
4 changed files with 10 additions and 9 deletions

View File

@@ -565,7 +565,7 @@ def is_trusted_proxy() -> bool:
Result is cached per-request in Flask's g object for efficiency.
"""
if hasattr(g, "_trusted_proxy"):
return g._trusted_proxy
return bool(g._trusted_proxy)
expected = current_app.config.get("TRUSTED_PROXY_SECRET", "")
if not expected:
@@ -573,7 +573,7 @@ def is_trusted_proxy() -> bool:
return True
provided = request.headers.get("X-Proxy-Secret", "")
g._trusted_proxy = hmac.compare_digest(expected, provided)
return g._trusted_proxy
return bool(g._trusted_proxy)
def get_client_fingerprint() -> str | None: